=================================================================== RCS file: /cvs/openbsd/update_openbsd/release.sh,v retrieving revision 1.14 retrieving revision 1.24 diff -u -r1.14 -r1.24 --- openbsd/update_openbsd/release.sh 2007/11/20 20:08:31 1.14 +++ openbsd/update_openbsd/release.sh 2008/10/20 23:06:57 1.24 @@ -1,7 +1,7 @@ #!/bin/sh -# $RedRiver: release.sh,v 1.13 2007/11/19 22:08:37 andrew Exp $ +# $RedRiver$ # -# Copyright (c) 2002 - 2007 Steven Roberts +# Copyright (c) 2002, 2008 Steven Roberts # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -16,27 +16,22 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -#TAG="OPENBSD_4_2" +local _origtag=${TAG} +TAG=`uname -sr | tr '[:lower:] .' '[:upper:]_'` KERNEL="GENERIC" -ARCH="i386" +ARCH=`machine` DEST="/home/destdir" RELEASE="/home/releasedir" -XSRCDIR="/usr/src/xenocara" +XSRCDIR="/usr/xenocara" PORTSPATH="/usr/ports" -DEST="/usr/dest" -RELEASE="/usr/release" -TAG=${TAG:=`uname -sr | tr '[:lower:] .' '[:upper:]_'`} -ARCH=`machine` -#SOURCES="src ports XF4" -#SOURCES="src ports" -SOURCES="/usr/src $XSRCDIR $PORTSPATH" +if [ -e /etc/releaserc ]; then + . /etc/releaserc +fi -# Anonymous CVS - http://www.openbsd.org/anoncvs.html -#CVSROOT="anoncvs@anoncvs3.usa.openbsd.org:/cvs" -#CVSROOT="anoncvs@anoncvs1.usa.openbsd.org:/cvs" -CVSROOT="anoncvs@rt.fm:/cvs" -export CVSROOT +if [ X"" != X"${_origtag}" ]; then + TAG=$_origtag +fi # See http://www.openbsd.org/anoncvs.html for instructions on fetching the @@ -44,12 +39,12 @@ update_sources() { echo "---------- Update sources ----------" -for d in $SOURCES; do - _cvstag=-r$CVSTAG - if [ X"$CVSTAG" == X"HEAD" ]; then - _cvstag=-A - fi - cd $d && cvs -q -z6 update $_cvstag -Pd +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 + fi done } @@ -59,27 +54,23 @@ config $KERNEL cd ../compile/$KERNEL make clean depend && make -cp /bsd /bsd.old && cp bsd / +make install } build_system() { echo "---------- Build a new system ----------" rm -rf /usr/obj/* cd /usr/src && nice make obj -cd /usr/src/etc && export DESTDIR=/ && make distrib-dirs +cd /usr/src/etc && env DESTDIR=/ make distrib-dirs cd /usr/src && nice make build -# Update /etc, /var, and /dev/MAKEDEV by hand. +echo Update /etc, /var, and /dev/MAKEDEV, either by hand or using sysmerge\(8\). } make_system_release() { echo "---------- Make and validate the system release ----------" cd /usr/src/distrib/crunch && make obj depend && make all install export DESTDIR=$DEST; export RELEASEDIR=$RELEASE -if (-e $DESTDIR); then - mkdir $DESTDIR/old- - mv $DESTDIR/* $DESTDIR/old- 2>/dev/null - rm -rf $DESTDIR/old- & -fi +rm -rf $DESTDIR mkdir -p $DESTDIR $RELEASEDIR cd /usr/src/etc && nice make release cd /usr/src/distrib/sets && sh checkflist @@ -88,7 +79,6 @@ build_xenocara() { echo "---------- Build and install xenocara ----------" -rm -rf /usr/xobj/* cd $XSRCDIR make bootstrap make obj @@ -98,11 +88,7 @@ make_xenocara_release() { echo "---------- Make and validate the xenocara release ----------" export DESTDIR=$DEST RELEASEDIR=$RELEASE -if (-e $DESTDIR); then - mkdir $DESTDIR/old- - mv $DESTDIR/* $DESTDIR/old- 2>/dev/null - rm -rf $DESTDIR/old- & -fi +rm -rf $DESTDIR mkdir -p $DESTDIR $RELEASEDIR cd $XSRCDIR nice make release @@ -120,13 +106,12 @@ 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 - Do system, xenocara, system-release, xenocara-release" echo } -if [ $# = 0 ]; then usage; exit 1; fi - if [ `whoami` != "root" ]; then -echo "You must be root to create a release." +echo "You must be root to build a release." exit 1 fi @@ -141,16 +126,11 @@ echo "Release: $RELEASE" echo +if [ $# = 0 ]; then usage; exit 1; fi + for i in $* do case $i in -full-release) -build_xenocara -build_system -make_xenocara_release -make_system_release -;; -case $i in update) update_sources ;; @@ -168,6 +148,12 @@ ;; xenocara-release) make_xenocara_release +;; +full-release) +build_system +build_xenocara +make_xenocara_release +make_system_release ;; *) echo "---------- Abort! Abort! ----------"