Index: release/generate-release.sh =================================================================== --- release/generate-release.sh (revision 224801) +++ release/generate-release.sh (working copy) @@ -20,11 +20,20 @@ # $FreeBSD$ # -mkdir -p $2/usr/src +if [ $# -ne 2 ]; then + echo >&2 "usage: $(dirname "$0") svn-branch scratch-dir" + exit 1 +fi + set -e # Everything must succeed +if [ -d $2 ]; then + (rm -Rf $2; chflags -R noschg $2; rm -Rf $2) +fi +mkdir -p $2/usr/src + svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src -if [ ! -z $CVSUP_HOST ]; then +if [ -n "$CVSUP_HOST" ]; then cat > $2/docports-supfile << EOF *default host=$CVSUP_HOST *default base=/var/db @@ -35,7 +44,7 @@ ports-all doc-all EOF -elif [ ! -z $CVSROOT ]; then +elif [ -n "$CVSROOT" ]; then cd $2/usr cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc @@ -47,7 +56,7 @@ mount -t devfs devfs $2/dev trap "umount $2/dev" EXIT # Clean up devfs mount on exit -if [ ! -z $CVSUP_HOST ]; then +if [ -n "$CVSUP_HOST" ]; then cp /etc/resolv.conf $2/etc/resolv.conf # Checkout ports and doc trees