Changeset d34f558


Ignore:
Timestamp:
12/23/13 07:27:42 (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
88e92b9
Parents:
6418349
Message:

Improve how we copy pcbsd.conf repo file, use a .dist template so that
we don't end up with a invalid pcbsd.conf file if the user kills the
pc-extractoverlay process during the extraction

Location:
src-sh/pc-extractoverlay
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src-sh/pc-extractoverlay/pc-extractoverlay

    r01aa046 rd34f558  
    129129 
    130130  # See if we need to adjust pcbsd.conf repo file 
    131   grep -q "ARCH" /usr/local/etc/pkg/repos/pcbsd.conf 2>/dev/null 
    132   if [ $? -eq 0 ] ; then 
    133     ARCH=`uname -m` 
    134     FBSDVER=`uname -r | cut -d '-' -f 1-2` 
     131  if [ ! -e "/usr/local/etc/pkg/repos/pcbsd.conf.dist" ];then 
     132     echo "WARNING: Missing /usr/local/etc/pkg/repos/pcbsd.conf.dist" 
     133     status="1" 
     134     return 
     135  fi 
    135136 
    136     # If using the EDGE package set, set the right path 
    137     case $PACKAGE_SET in 
    138          EDGE) FBSDVER="$FBSDVER/edge";; 
    139             *) ;; 
    140     esac 
     137  ARCH=`uname -m` 
     138  FBSDVER=`uname -r | cut -d '-' -f 1-2` 
    141139 
    142     sed -i '' "s|VERSION|$FBSDVER|g" /usr/local/etc/pkg/repos/pcbsd.conf 
    143     if [ $? -ne 0 ] ; then 
    144        echo "WARNING: Failed setting VERSION in pcbsd.conf" 
    145        status="1" 
    146     fi 
    147     sed -i '' "s|ARCH|$ARCH|g" /usr/local/etc/pkg/repos/pcbsd.conf 
    148     if [ $? -ne 0 ] ; then 
    149        echo "WARNING: Failed setting ARCH in pcbsd.conf" 
    150        status="1" 
    151     fi 
    152   fi 
     140  # If using the EDGE package set, set the right path 
     141  case $PACKAGE_SET in 
     142       EDGE) FBSDVER="$FBSDVER/edge";; 
     143          *) ;; 
     144  esac 
     145 
     146  # Setup new pcbsd.conf repo file 
     147  cat /usr/local/etc/pkg/repos/pcbsd.conf.dist \ 
     148        | sed "s|VERSION|$FBSDVER|g" \ 
     149        | sed "s|ARCH|$ARCH|g" > /usr/local/etc/pkg/repos/pcbsd.conf 
    153150} 
    154151 
Note: See TracChangeset for help on using the changeset viewer.