=================================================================== RCS file: /cvs/openbsd/update_openbsd/release.sh,v retrieving revision 1.31 retrieving revision 1.37 diff -u -r1.31 -r1.37 --- openbsd/update_openbsd/release.sh 2010/02/10 20:57:07 1.31 +++ openbsd/update_openbsd/release.sh 2015/11/27 22:36:12 1.37 @@ -1,5 +1,5 @@ #!/bin/sh -# $AFresh1: release.sh,v 1.30 2009/12/03 17:28:37 andrew Exp $ +# $AFresh1: release.sh,v 1.36 2014/11/27 21:17:46 andrew Exp $ # # Copyright (c) 2002, 2008 Steven Roberts # @@ -53,9 +53,11 @@ echo "---------- Update sources ----------" local _d for _d in /usr/src "${XSRCDIR}" "${PORTSPATH}"; do - if [ -d $_d ]; then - echo [$_d] cvs update -r$TAG -Pd - cd $_d && cvs update -r$TAG -Pd || exit 255 + if [ -d $_d -a -e $_d/CVS ]; then + R="-r$TAG" + [ "$TAG" = "HEAD" ] && R="-A" + echo [$_d] cvs update $R -Pd + cd $_d && cvs update $R -Pd || exit 255 fi done } @@ -75,8 +77,8 @@ fi if [ $_status != 0 ]; then echo Kernel Build Failed + exit $_status fi -exit $_status } build_system() { @@ -84,42 +86,43 @@ local _status=0 unset DESTDIR RELEASEDIR empty_dir /usr/obj & -cd /usr/src && nice make obj +cd /usr/src && nice make $BUILD_ARGS obj _status=$? if [ $_status == 0 ]; then cd /usr/src/etc && env DESTDIR=/ $SUDO make distrib-dirs _status=$? fi if [ $_status == 0 ]; then - cd /usr/src && nice make SUDO="${SUDO}" build + cd /usr/src && nice make SUDO="${SUDO}" $BUILD_ARGS build fi if [ $_status != 0 ]; then echo System Build Failed + exit $_status +else + echo Update /etc, /var, and /dev/MAKEDEV, either by hand or using sysmerge\(8\). fi -echo Update /etc, /var, and /dev/MAKEDEV, either by hand or using sysmerge\(8\). -exit $_status } make_system_release() { echo "---------- Make and validate the system release ----------" -local _status=0 -export DESTDIR=$DEST; export RELEASEDIR=$RELEASE -if [ X"$DESTDIR" == X"" ]; then +if [ X"$DEST" == X"" ]; then echo PLEASE SET \$DEST! >2& - exit + exit 1 fi -mkdir -p $DESTDIR $RELEASEDIR -empty_dir $DESTDIR & -cd /usr/src/etc && ${SUDO} nice make release + +local _status=0 +local DESTDIR RELEASEDIR + +[ -e $DEST ] && empty_dir $DEST +${SUDO} install -d -g wheel -m 775 $DEST $RELEASE + +export DESTDIR=$DEST RELEASEDIR=$RELEASE +cd /usr/src/etc && ${SUDO} nice make SUDO="" release _status=$? -if [ $_status == 0 ]; then - cd /usr/src/distrib/sets && ${SUDO} sh checkflist - _status=$? -fi -unset DESTDIR RELEASEDIR -if [ $_status != 0 ]; then - echo System Release Failed -fi +[ $_status == 0 ] && cd /usr/src/distrib/sets && ${SUDO} sh checkflist +_status=$? + +[ $_status == 0 ] || echo System Release Failed exit $_status } @@ -129,20 +132,23 @@ unset DESTDIR RELEASEDIR empty_dir /usr/xobj & cd $XSRCDIR -make bootstrap _status=$? if [ $_status == 0 ]; then - make obj + make $BUILD_ARGS bootstrap _status=$? fi if [ $_status == 0 ]; then - make build + make $BUILD_ARGS obj _status=$? fi +if [ $_status == 0 ]; then + make $BUILD_ARGS build + _status=$? +fi if [ $_status != 0 ]; then echo Xenocara Build Failed + exit $_status fi -exit $_status } make_xenocara_release() { @@ -156,13 +162,16 @@ mkdir -p $DESTDIR $RELEASEDIR empty_dir $DESTDIR & cd $XSRCDIR -nice make release _status=$? +if [ $_status == 0 ]; then + nice make release + _status=$? +fi unset DESTDIR RELEASEDIR if [ $_status != 0 ]; then echo Xenocara Release Failed + exit $_status fi -exit $_status } usage() { @@ -176,7 +185,7 @@ echo " system-release - Make and validate the system release" echo " xenocara - Build and install xenocara" echo " xenocara-release - Make and validate the xenocara release" -echo " full-release - xenocara, xenocara-release, system, system-release" +echo " full - xenocara, xenocara-release, system, system-release" echo } @@ -205,28 +214,28 @@ do case $i in update) -update_sources || exit 10 +update_sources ;; kernel) -build_kernel || exit 20 +build_kernel ;; system) -build_system || exit 30 +build_system ;; system-release) -make_system_release || exit 35 +make_system_release ;; xenocara) -build_xenocara || exit 40 +build_xenocara ;; xenocara-release) -make_xenocara_release || exit 45 +make_xenocara_release ;; -full-release) -build_xenocara || exit 51 -make_xenocara_release || exit 52 -build_system || exit 53 -make_system_release || exit 54 +full) +build_xenocara +make_xenocara_release +build_system +make_system_release ;; *) echo "---------- Abort! Abort! ----------"