[BACK]Return to update_openbsd CVS log [TXT][DIR] Up to [local] / openbsd / update_openbsd

Diff for /openbsd/update_openbsd/update_openbsd between version 1.66 and 1.75

version 1.66, 2014/02/01 22:07:04 version 1.75, 2015/05/03 00:27:01
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $AFresh1: update_openbsd,v 1.65 2014/02/01 19:13:53 andrew Exp $  # $AFresh1: update_openbsd,v 1.74 2015/03/21 22:50:18 andrew Exp $
 #  #
 # Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com>  # Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com>
 #  #
Line 27 
Line 27 
     local xserv=/usr/X11R6/bin/X      local xserv=/usr/X11R6/bin/X
     local xshare=/usr/X11R6/bin/startx      local xshare=/usr/X11R6/bin/startx
   
       local _nv=`echo $NEW_VER | sed -e 's/\.//'`
     local _c _d _e      local _c _d _e
     echo -n base      echo -n base
     echo -n ' etc'      [ $_nv -lt 57 ] && echo -n ' etc'
     for _d in misc man comp game xbase xetc xfont xserv xshare; do      for _d in misc man comp game xbase xetc xfont xserv xshare; do
           [ $_d = xetc -a $_nv -ge 57 ] && continue
         eval _e=\$${_d}          eval _e=\$${_d}
         _c=`ls $_e 2> /dev/null | wc -l`          _c=`ls $_e 2> /dev/null | wc -l`
         #echo $_c $_d $_e          #echo $_c $_d $_e
Line 222 
Line 224 
         if [ ! -e ./${_b} ]; then          if [ ! -e ./${_b} ]; then
             echo "===> $FTP_CMD ${FTP}/${_b}"              echo "===> $FTP_CMD ${FTP}/${_b}"
             $FTP_CMD ${FTP}/${_b}              $FTP_CMD ${FTP}/${_b}
           else
               echo "===> Have ${_b}"
         fi          fi
           kernel_file_version "${_b}"
     done      done
   
     for _s in $INSTALLED_SETS; do      for _s in $INSTALLED_SETS; do
           [ "$_v" -ge "57" -a "$_s" != "${_s%etc}" ] && continue
         local _file=${_s}${_v}.tgz          local _file=${_s}${_v}.tgz
         if [ ${_s} == sendmail-smtp_auth ]; then          if [ ${_s} == sendmail-smtp_auth ]; then
             _file=${_s}.gz              _file=${_s}.gz
Line 271 
Line 277 
   
     local _nv=`echo $NEW_VER | sed -e 's/\.//'`      local _nv=`echo $NEW_VER | sed -e 's/\.//'`
     local _signify=`which signify 2>/dev/null`      local _signify=`which signify 2>/dev/null`
     local _keyfile=/etc/signify/${_nv}base.pub      local _keyfile=/etc/signify/openbsd-${_nv}-base.pub
     local _b _s      local _b _s
   
     (      (
Line 286 
Line 292 
             echo "key [$_keyfile] does not exist, cannot check $_type" >&2              echo "key [$_keyfile] does not exist, cannot check $_type" >&2
             return 2              return 2
         fi          fi
         signify -V -e -p $_keyfile -x $_type -m - | grep -f index | sum -c -          signify -V -e -p $_keyfile -x $_type -m - | grep -f index | sha256 -c -
     else      else
        grep -f index $_type | sum -c         grep -f index $_type | sha256 -c
     fi      fi
   
     if [ $? -ne 0 ]; then      if [ $? -ne 0 ]; then
Line 323 
Line 329 
     fi      fi
   
     for _s in $INSTALLED_SETS; do      for _s in $INSTALLED_SETS; do
           [ "$_v" -ge "57" -a "$_s" != "${_s%etc}" ] && continue
         local _file=${_s}${_v}.tgz          local _file=${_s}${_v}.tgz
         if [ ${_s} == sendmail-smtp_auth ]; then          if [ ${_s} == sendmail-smtp_auth ]; then
             _file=${_s}.gz              _file=${_s}.gz
Line 339 
Line 346 
   
     local _type      local _type
     for _type in $CHECKSUM_TYPES; do      for _type in $CHECKSUM_TYPES; do
           [ -n "$NO_SIGNIFY" -a "$_type" != "${_type%.sig}" ] && continue
         if [ -e $_type ]; then          if [ -e $_type ]; then
             check_sum $_type && break              check_sum $_type && break
             [ -z "$IGNORE_CHECKSUM_ERROR" ] && exit 1              [ -z "$IGNORE_CHECKSUM_ERROR" ] && exit 1
Line 462 
Line 470 
         exit 1;          exit 1;
     fi      fi
   
     if [ X"" == X"$RELEASEDIR" ]; then  
         echo "ERROR: no source for etc!" >&2  
         exit 1  
     fi  
   
     cd $RELEASEDIR  
   
     local _v=$FILE_VER      local _v=$FILE_VER
     local _args=""      local _args=""
     if [ -e etc${_v}.tgz ]; then  
         _args="$_args -s ${RELEASEDIR}/etc${_v}.tgz"      if [ ! -e /usr/share/sysmerge/etc.tgz ]; then
           if [ X"" == X"$RELEASEDIR" ]; then
               echo "ERROR: no source for etc!" >&2
               exit 1
           fi
   
           cd $RELEASEDIR
   
           if [ -e etc${_v}.tgz ]; then
               _args="$_args -s ${RELEASEDIR}/etc${_v}.tgz"
           fi
           if [ -e xetc${_v}.tgz ]; then
               _args="$_args -x ${RELEASEDIR}/xetc${_v}.tgz"
           fi
           if [ X"" == X"$_args" ]; then
               echo ERROR: No upgrade sets found! >&2
               exit 1
           fi
     fi      fi
     if [ -e xetc${_v}.tgz ]; then  
         _args="$_args -x ${RELEASEDIR}/xetc${_v}.tgz"  
     fi  
     if [ X"" == X"$_args" ]; then  
         echo ERROR: No upgrade sets found! >&2  
     else  
         echo '==> RUNNING SYSMERGE'  
         $SYSMERGE $_args  
     fi  
   
       echo '==> RUNNING SYSMERGE'
       $SYSMERGE $_args
   
     cd $OLDPWD      cd $OLDPWD
 }  }
   
Line 505 
Line 517 
 FTP_CMD=${FTP_CMD:=ftp -V}  FTP_CMD=${FTP_CMD:=ftp -V}
 PKG_PATH=${PKG_PATH:=/usr/ports/packages/`machine`/all/:${MIRROR}/`uname -r`/packages/`machine`/}  PKG_PATH=${PKG_PATH:=/usr/ports/packages/`machine`/all/:${MIRROR}/`uname -r`/packages/`machine`/}
   
   set_version
   
 DESTDIR=${DESTDIR:=/}  DESTDIR=${DESTDIR:=/}
 SYSMERGE=${SYSMERGE:=/usr/sbin/sysmerge}  SYSMERGE=${SYSMERGE:=/usr/sbin/sysmerge}
 FORCE_DIR=${FORCE_DIR:=No}  FORCE_DIR=${FORCE_DIR:=No}
Line 513 
Line 527 
   
 CHECKSUM_TYPES=${CHECKSUM_TYPES:=SHA256.sig SHA256}  CHECKSUM_TYPES=${CHECKSUM_TYPES:=SHA256.sig SHA256}
   
 set_version  
 local _error=$?  local _error=$?
   
 echo  echo
Line 533 
Line 546 
 #echo "       FILE_VER: $FILE_VER"  #echo "       FILE_VER: $FILE_VER"
 echo  echo
   
   for k in $INSTALL_KERNELS; do
       if [ -e "/$k" ]; then
           echo "Existing $k"
           kernel_file_version "/$k"
       fi
   done
   
 if [ ${_error} -ne 0 ]; then  if [ ${_error} -ne 0 ]; then
         exit ${_error}          exit ${_error}
 fi  fi
Line 589 
Line 609 
   
     if [ -e /sbin/oreboot ]; then      if [ -e /sbin/oreboot ]; then
         echo Removing /sbin/oreboot          echo Removing /sbin/oreboot
         $rm -f /sbin/oreboot          rm -f /sbin/oreboot
     fi      fi
     update_etc      update_etc
   
     echo '==> UPDATING PACKAGES'      echo '==> UPDATING PACKAGES'
     pkg_add -ui -F update -F updatedepends      pkg_add -ui -F update -F updatedepends
   
       echo '==> UPDATING FIRMWARE'
       fw_update
   
 else  else
     echo Instructions for updating to the new version available from      echo Instructions for updating to the new version available from

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.75

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>