[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.72 and 1.87

version 1.72, 2015/01/18 03:41:33 version 1.87, 2017/11/28 02:52:31
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $AFresh1: update_openbsd,v 1.71 2015/01/18 03:01:08 andrew Exp $  # $AFresh1: update_openbsd,v 1.86 2017/03/01 03:22:51 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 58 
Line 60 
             local _list=`echo "ls base*.tgz" | ${FTP_CMD} ${FTP}/`              local _list=`echo "ls base*.tgz" | ${FTP_CMD} ${FTP}/`
             _file=`echo ${_list} | awk '/base[0-9][0-9].tgz/ { print $9 }'`              _file=`echo ${_list} | awk '/base[0-9][0-9].tgz/ { print $9 }'`
   
         elif [ X"http" == X"${_proto}" ]; then          elif [ X"http" == X"${_proto}" -o X"https" == X"${_proto}" ]; then
             local _list=`${FTP_CMD} -V -o - ${FTP}/`              local _list=`${FTP_CMD} -V -o - ${FTP}/`
             _file=`echo ${_list} | awk '/[^x]base[0-9][0-9]*\.tgz/ {              _file=`echo ${_list} | awk '/[^x]base[0-9][0-9]*\.tgz/ {
                     sub("^.*base","base");                      sub("^.*base","base");
Line 255 
Line 257 
     local _file=$1      local _file=$1
     # This could go circular, but I dunno how to fix that.      # This could go circular, but I dunno how to fix that.
     if [ -h $_file ]; then      if [ -h $_file ]; then
         follow_symlink $( file $_file |          follow_symlink $( readlink -f $_file )
             grep 'symbolic link' |  
             sed -e s/^.*\\\`// -e s/\\\'\$// )  
     else      else
         echo $_file          echo $_file
     fi      fi
Line 292 
Line 292 
         fi          fi
         signify -V -e -p $_keyfile -x $_type -m - | grep -f index | sha256 -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 339 
Line 339 
     done      done
   
     if [ X"" == X"${_missing_sets}" ]; then      if [ X"" == X"${_missing_sets}" ]; then
         echo '===> All OK'          echo 'All OK'
     fi      fi
   
     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 381 
Line 382 
         local _is_boot=""          local _is_boot=""
         [ X"$BOOT_KERNEL" == X"/${_bd}" ] && _is_boot="# boot kernel"          [ X"$BOOT_KERNEL" == X"/${_bd}" ] && _is_boot="# boot kernel"
   
         echo "===> Copying $_b to /$_bd $_is_boot"          echo "Copying $_b to /$_bd $_is_boot"
         cp ${_b} /nbsd && mv /nbsd /${_bd}          cp ${_b} /nbsd && mv /nbsd /${_bd}
         if [ $? -ne 0 ]; then          if [ $? -ne 0 ]; then
             echo ERROR: Could not copy new $_bd kernel! >&2              echo ERROR: Could not copy new $_bd kernel! >&2
Line 430 
Line 431 
             _path=/var/tmp/temproot              _path=/var/tmp/temproot
         fi          fi
   
         echo "===> Extracting $_f to $_path"          echo "Extracting $_f to $_path"
         mkdir -p $_path          mkdir -p $_path
         tar -C $_path -xzphf ${RELEASEDIR}/${_f}          tar -C $_path -xzphf ${RELEASEDIR}/${_f}
         if [ $? -ne 0 ]; then          if [ $? -ne 0 ]; then
Line 470 
Line 471 
     local _v=$FILE_VER      local _v=$FILE_VER
     local _args=""      local _args=""
   
     if [ ! -e /usr/share/sysmerge/etc.tgz ]; then      if [ ! -e /var/sysmerge/etc.tgz ]; then
         if [ X"" == X"$RELEASEDIR" ]; then          if [ X"" == X"$RELEASEDIR" ]; then
             echo "ERROR: no source for etc!" >&2              echo "ERROR: no source for etc!" >&2
             exit 1              exit 1
Line 518 
Line 519 
 SYSMERGE=${SYSMERGE:=/usr/sbin/sysmerge}  SYSMERGE=${SYSMERGE:=/usr/sbin/sysmerge}
 FORCE_DIR=${FORCE_DIR:=No}  FORCE_DIR=${FORCE_DIR:=No}
   
   export PKG_PATH TRUSTED_PKG_PATH
   
   set_version
   
 INSTALLED_SETS=${INSTALLED_SETS:=`installed_sets`}  INSTALLED_SETS=${INSTALLED_SETS:=`installed_sets`}
   
 CHECKSUM_TYPES=${CHECKSUM_TYPES:=SHA256.sig SHA256}  CHECKSUM_TYPES=${CHECKSUM_TYPES:=SHA256.sig SHA256}
   
 set_version  
 local _error=$?  local _error=$?
   
 echo  echo
 echo "-= update_openbsd - helper script to update OpenBSD =-"  echo "-= update_openbsd - helper script to update OpenBSD =-"
 echo "------------------------------------------------------"  echo "------------------------------------------------------"
 echo  echo
 echo "       SYSMERGE: $SYSMERGE"  echo "        SYSMERGE: $SYSMERGE"
 echo "         MIRROR: $MIRROR"  echo "          MIRROR: $MIRROR"
 echo "     RELEASEDIR: $RELEASEDIR"  echo "        PKG_PATH: $PKG_PATH"
 echo "        DESTDIR: $DESTDIR"  echo "TRUSTED_PKG_PATH: $TRUSTED_PKG_PATH"
 echo "    BOOT_KERNEL: $BOOT_KERNEL"  echo "      RELEASEDIR: $RELEASEDIR"
 echo "INSTALL_KERNELS: $INSTALL_KERNELS"  echo "         DESTDIR: $DESTDIR"
 echo " INSTALLED_SETS: $INSTALLED_SETS"  echo "     BOOT_KERNEL: $BOOT_KERNEL"
   echo " INSTALL_KERNELS: $INSTALL_KERNELS"
   echo "  INSTALLED_SETS: $INSTALLED_SETS"
 echo  echo
 echo "        CUR_VER: $CUR_VER"  echo "         CUR_VER: $CUR_VER"
 echo "        NEW_VER: $NEW_VER"  echo "         NEW_VER: $NEW_VER"
 #echo "       FILE_VER: $FILE_VER"  #echo "        FILE_VER: $FILE_VER"
 echo  echo
   
 for k in $INSTALL_KERNELS; do  for k in $INSTALL_KERNELS; do
Line 581 
Line 587 
     echo "!!!  at the end of the proces but it is safer to  !!!" >&2      echo "!!!  at the end of the proces but it is safer to  !!!" >&2
     echo "!!!  have a separate root shell open.             !!!" >&2      echo "!!!  have a separate root shell open.             !!!" >&2
     echo "!!!  It is needed in order to run /sbin/oreboot.  !!!" >&2      echo "!!!  It is needed in order to run /sbin/oreboot.  !!!" >&2
     echo "!!!  sudo MAY NOT WORK after sets are extracted.  !!!" >&2      echo "!!!  doas MAY NOT WORK after sets are extracted.  !!!" >&2
     echo >&2      echo >&2
     echo "enter to continue, ctrl+C to cancel" >&2      echo "enter to continue, ctrl+C to cancel" >&2
     local _temp      local _temp
Line 609 
Line 615 
     fi      fi
     update_etc      update_etc
   
     echo '==> UPDATING PACKAGES'      OPENUP=$( which openup 2>/dev/null )
     pkg_add -ui -F update -F updatedepends      if [ -n "$OPENUP" ]; then
           echo "==> UPDATING WITH $OPENUP"
           $OPENUP
       else
           echo '==> UPDATING PACKAGES'
           pkg_add -u
       fi
   
     echo '==> UPDATING FIRMWARE'      echo '==> UPDATING FIRMWARE'
     fw_update      fw_update
   
 else  else
       [ -e /etc/rc.sysmerge ] && grep -q $SYSMERGE /etc/rc.sysmerge ||
           echo "$SYSMERGE -b" >>/etc/rc.sysmerge &&
           echo "==> RUNNING $SYSMERGE -b ON REBOOT"
   
     echo Instructions for updating to the new version available from      echo Instructions for updating to the new version available from
     if [ X"snapshots" == X"$FORCE_DIR" ]; then      if [ X"snapshots" == X"$FORCE_DIR" ]; then
         echo "  http://www.openbsd.org/faq/current.html"          echo "  http://www.openbsd.org/faq/current.html"

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.87

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