=================================================================== RCS file: /cvs/openbsd/update_openbsd/release.sh,v retrieving revision 1.1 retrieving revision 1.12 diff -u -r1.1 -r1.12 --- openbsd/update_openbsd/release.sh 2006/10/11 00:41:42 1.1 +++ openbsd/update_openbsd/release.sh 2007/09/09 22:40:41 1.12 @@ -1,5 +1,5 @@ #!/bin/sh -# +# $RedRiver: release.sh,v 1.11 2007/05/04 20:57:34 andrew Exp $ # Copyright (c) 2002 - 2006, FenderQ # All rights reserved. # @@ -36,24 +36,35 @@ # SEE ALSO release(8) # -DEST="/home/destdir" -RELEASE="/home/releasedir" -CVSTAG="OPENBSD_3_9" +DEST="/usr/dest" +RELEASE="/usr/release" +CVSTAG=${CVSTAG:=`uname -sr | tr '[:lower:] .' '[:upper:]_'`} +#SOURCES="src ports XF4" +#SOURCES="src ports" +SOURCES="src ports XF4" # Anonymous CVS - http://www.openbsd.org/anoncvs.html -CVSROOT="anoncvs@openbsd.sunsite.ualberta.ca:/cvs" +CVSROOT="anoncvs@anoncvs3.usa.openbsd.org:/cvs" export CVSROOT install_sources() { echo "********** Install sources **********" cd /usr - rm -rf src/* XF4 ports - cvs -q -z6 checkout -r$CVSTAG -P src XF4 ports + for d in $SOURCES; do + rm -rf $d/* + cvs -q -z6 checkout -r$CVSTAG -P $d + done } update_sources() { echo "********** Update sources **********" - cd /usr && cvs -q -z6 update -r$CVSTAG -Pd src XF4 ports + for d in $SOURCES; do + _cvstag=-r$CVSTAG + if [ X"$CVSTAG" == X"HEAD" ]; then + _cvstag=-A + fi + cd /usr && cvs -q -z6 update $_cvstag -Pd $d + done } build_kernel() { @@ -77,10 +88,11 @@ echo "********** Make and validate the system release **********" cd /usr/src/distrib/crunch && make obj depend all install export DESTDIR=$DEST RELEASEDIR=$RELEASE - rm -rf $DESTDIR + rm -rf $DESTDIR/* mkdir -p $DESTDIR $RELEASEDIR cd /usr/src/etc && nice make release cd /usr/src/distrib/sets && sh checkflist + ls $RELEASEDIR | grep -v index.txt | sort > $RELEASEDIR/index.txt unset DESTDIR RELEASEDIR } @@ -96,15 +108,17 @@ make_release_XF4() { echo "********** Make and validate the XF4 release **********" export DESTDIR=$DEST RELEASEDIR=$RELEASE - rm -rf $DESTDIR + rm -rf $DESTDIR/* mkdir -p $DESTDIR $RELEASEDIR - nice make release + cd /usr/Xbuild && nice make release + cd /usr/Xbuild/distrib/sets && sh checkflist + ls $RELEASEDIR | grep -v index.txt | sort > $RELEASEDIR/index.txt unset DESTDIR RELEASEDIR } clean_everything() { echo "********** Clean everything **********" - rm -rf /usr/obj/* $DEST /usr/Xbuild + rm -rf /usr/obj/* $DEST/* /usr/Xbuild } usage() { @@ -123,11 +137,6 @@ echo } -if [ `whoami` != "root" ]; then - echo "You probably should be root instead of `whoami` to run this safely." - exit 1 -fi - START=`date` echo echo "***** OpenBSD - Release Building *****" @@ -139,6 +148,11 @@ echo if [ $# = 0 ]; then usage; exit 1; fi + +if [ `id -u` != "0" ]; then + echo "You probably should be root instead of `whoami` to run this safely." + exit 1 +fi for i in $* do