=================================================================== RCS file: /cvs/openbsd/update_openbsd/update_openbsd,v retrieving revision 1.39 retrieving revision 1.45 diff -u -r1.39 -r1.45 --- openbsd/update_openbsd/update_openbsd 2012/12/08 19:52:08 1.39 +++ openbsd/update_openbsd/update_openbsd 2012/12/16 01:56:46 1.45 @@ -1,5 +1,20 @@ #!/bin/sh -# $AFresh1: update_openbsd,v 1.38 2012/04/19 04:03:47 andrew Exp $ +# $AFresh1: update_openbsd,v 1.44 2012/12/09 04:08:37 andrew Exp $ +# +# Copyright (c) 2012 Andrew Fresh +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# installed_sets() { local misc=/usr/share/doc/README @@ -160,8 +175,8 @@ [ -e /boot.conf ] && sed -E '/^ *(set +image|boot) +/!d ; \ s///; s/^.*://; s/ .*$//' /boot.conf \ ) | tail -1` + BOOT_KERNEL=`follow_symlink /$BOOT_KERNEL` BOOT_KERNEL="/${BOOT_KERNEL#/}" - BOOT_KERNEL=`follow_symlink $BOOT_KERNEL` BOOT_KERNEL_VERSION=`kernel_file_version $BOOT_KERNEL` @@ -196,7 +211,7 @@ local _v=$FILE_VER for _b in $INSTALL_KERNELS; do - if [ -e /${_b} -a ! -e ./${_b} ]; then + if [ ! -e ./${_b} ]; then echo $FTP_CMD ${FTP}/${_b} $FTP_CMD ${FTP}/${_b} fi @@ -216,10 +231,9 @@ local _type for _type in $CHECKSUM_TYPES; do - if [ ! -e $_type ]; then - echo $FTP_CMD ${FTP}/$_type - $FTP_CMD ${FTP}/$_type - fi + [ -e $_type ] && break + echo $FTP_CMD ${FTP}/$_type + $FTP_CMD ${FTP}/$_type done } @@ -542,10 +556,22 @@ read _temp fi -if [ X"" != X"$SUDO" ]; then - echo Please enter your sudo password if prompted. - echo You may be asked for it again later in the process. - $SUDO -v +if [ -n "$SUDO" -a $CUR_VER != $NEW_VER ]; then + echo >&2 + echo "!!! You are upgrading between OpenBSD versions. !!!" >&2 + echo "!!! You should make sure you have a root shell open !!!" >&2 + echo "!!! It is needed in order to run /sbin/oreboot. !!!" >&2 + echo "!!! sudo MAY NOT WORK after sets are extracted. !!!" >&2 + echo >&2 + echo "ctrl+C to cancel, enter to continue" >&2 + local _temp + read _temp +fi + +if [ -n "$SUDO" ]; then + echo + echo You may be asked for your sudo password multiple times. + $SUDO -v -p "sudo Password: " fi install_kernels