=================================================================== RCS file: /cvs/openbsd/update_openbsd/update_openbsd,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- openbsd/update_openbsd/update_openbsd 2008/11/09 07:22:52 1.11 +++ openbsd/update_openbsd/update_openbsd 2008/11/12 06:07:42 1.12 @@ -1,5 +1,5 @@ #!/bin/sh -# $RedRiver: update_openbsd,v 1.10 2008/11/05 17:07:58 andrew Exp $ +# $RedRiver: update_openbsd,v 1.11 2008/11/09 07:22:52 andrew Exp $ if [ -e /etc/update_openbsd.conf ]; then . /etc/update_openbsd.conf @@ -51,7 +51,7 @@ ${FTP_CMD} -V -o - ${FTP}/ | grep '"base[0-9][0-9].tgz' | sed -e 's/.*\(base..\.tgz\).*/\1/' else echo Unsupported FTP ${FTP} >&2 - exit 2 + return 2 fi } @@ -102,7 +102,7 @@ if [ X"" == X"${_file}" ]; then if [ X"No" != X"$FORCE_DIR" ]; then echo No sets in forced [${FTP}] >&2 - exit 2 + return 2 fi NEW_VER=$CUR_VER @@ -112,7 +112,7 @@ _file=`sets_exist` if [ X"" == X"${_file}" ]; then echo No sets in [${FTP}] >&2 - exit 2 + return 2 fi fi @@ -121,14 +121,14 @@ if [ X"" == X"${_v}" ]; then echo No version in file [$_file] >&2 - exit 2 + return 2 elif [ X"${_cv}" == X"${_v}" ]; then NEW_VER=$CUR_VER elif [ X"${_nv}" == X"${_v}" ]; then NEW_VER=$NEW_VER else echo Invalid version [$_v] >&2 - exit 2 + return 2 fi if [ X"No" == X"$FORCE_DIR" ]; then @@ -139,7 +139,7 @@ if [ X"" == X"${_v}" ]; then echo ERROR: Unable to determine file version! >&2 - exit 1 + return 1 fi if [ X"" == X"$RELEASEDIR" ]; then @@ -154,7 +154,7 @@ echo '### GETTING SETS ###' if [ X"" == X"$FTP" ]; then echo ERROR: No FTP site set! >&2 - exit 1 + return 1 fi mkdir -p ${RELEASEDIR} @@ -186,7 +186,7 @@ if [ $? -ne 0 ]; then echo ERROR: MD5 does not match! >&2 - exit 1 + return 1 fi } @@ -359,6 +359,7 @@ } set_version +local _error=$? echo echo "-= update_openbsd - helper script to update OpenBSD =-" @@ -375,6 +376,10 @@ echo " NEW_VER: $NEW_VER" #echo " FILE_VER: $FILE_VER" echo + +if [ ${_error} -ne 0 ]; then + exit ${_error} +fi get_sets