=================================================================== RCS file: /cvs/openbsd/update_openbsd/release.sh,v retrieving revision 1.23 retrieving revision 1.28 diff -u -r1.23 -r1.28 --- openbsd/update_openbsd/release.sh 2008/10/11 23:11:58 1.23 +++ openbsd/update_openbsd/release.sh 2008/11/05 17:14:40 1.28 @@ -1,5 +1,5 @@ #!/bin/sh -# $RedRiver: release.sh,v 1.22 2008/07/08 22:46:01 andrew Exp $ +# $RedRiver: release.sh,v 1.27 2008/11/05 16:43:57 andrew Exp $ # # Copyright (c) 2002, 2008 Steven Roberts # @@ -16,7 +16,8 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # -TAG=${TAG:=`uname -sr | tr '[:lower:] .' '[:upper:]_'`} +local _origtag=${TAG} +TAG=`uname -sr | tr '[:lower:] .' '[:upper:]_'` KERNEL="GENERIC" ARCH=`machine` DEST="/home/destdir" @@ -24,22 +25,27 @@ XSRCDIR="/usr/xenocara" PORTSPATH="/usr/ports" -if [ -e ${HOME}/.releaserc ]; then - . ${HOME}/.releaserc +if [ -e /etc/release.conf ]; then + . /etc/release.conf fi +export CVSROOT +if [ X"" != X"${_origtag}" ]; then + TAG=$_origtag +fi + + # See http://www.openbsd.org/anoncvs.html for instructions on fetching the # sources for the first time. update_sources() { echo "---------- Update sources ----------" -_cvstag=-r$TAG -if [ X"$TAG" == X"HEAD" ]; then - _cvstag="" -fi -for d in /usr/src ${XSRCDIR} ${PORTSPATH}; do - echo "cd $d && opencvs update $_cvstag -Pd" - cd $d && opencvs 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 } @@ -58,14 +64,18 @@ cd /usr/src && nice make obj 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 -rm -rf $DESTDIR +if [ X"$DESTDIR" == X"" ]; then + echo PLEASE SET \$DEST! >2& + exit +fi +rm -rf $DESTDIR/* $DESTDIR/.* mkdir -p $DESTDIR $RELEASEDIR cd /usr/src/etc && nice make release cd /usr/src/distrib/sets && sh checkflist @@ -74,8 +84,6 @@ build_xenocara() { echo "---------- Build and install xenocara ----------" -rm -rf /usr/xobj/* -mkdir -p /usr/xobj cd $XSRCDIR make bootstrap make obj @@ -85,7 +93,11 @@ make_xenocara_release() { echo "---------- Make and validate the xenocara release ----------" export DESTDIR=$DEST RELEASEDIR=$RELEASE -rm -rf $DESTDIR +if [ X"$DESTDIR" == X"" ]; then + echo PLEASE SET \$DEST! >2& + exit +fi +rm -rf $DESTDIR/* $DESTDIR/.* mkdir -p $DESTDIR $RELEASEDIR cd $XSRCDIR nice make release @@ -103,7 +115,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 - Do system, xenocara, system-release, xenocara-release" +echo " full-release - xenocara, xenocara-release, system, system-release" echo } @@ -121,6 +133,9 @@ echo " Kernel: $KERNEL-$ARCH" echo " Dest: $DEST" echo "Release: $RELEASE" +if [ X"$CVSROOT" != X"" ]; then + echo " Root: $CVSROOT" +fi echo if [ $# = 0 ]; then usage; exit 1; fi @@ -128,12 +143,6 @@ for i in $* do case $i in -full-release) -build_xenocara -build_system -make_xenocara_release -make_system_release -;; update) update_sources ;; @@ -151,6 +160,12 @@ ;; xenocara-release) make_xenocara_release +;; +full-release) +build_xenocara +make_xenocara_release +build_system +make_system_release ;; *) echo "---------- Abort! Abort! ----------"