aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2012-10-27 19:40:25 +0000
committerHiroki Sato <hrs@FreeBSD.org>2012-10-27 19:40:25 +0000
commit451a0efc67693b173b694335081a2c20a40219ac (patch)
treeb5afca4ee67e30a663fc7c734034e0916ece9179
parenta2a1ebc1d97bcfe9cc24d0b9e7613efb673b6763 (diff)
downloadsrc-451a0efc67693b173b694335081a2c20a40219ac.tar.gz
src-451a0efc67693b173b694335081a2c20a40219ac.zip
MFC of 240586 and 240587 to unbreak release building:
Update generate-release.sh script: - Use svn for ports and doc trees - When installing a binary textproc/docproj package, switch pkg_add(1) to pkg(8) [1] Approved by: re (implicitly)
Notes
Notes: svn path=/releng/9.1/; revision=242186
-rwxr-xr-xrelease/generate-release.sh69
1 files changed, 37 insertions, 32 deletions
diff --git a/release/generate-release.sh b/release/generate-release.sh
index cdba0267346f..881906746ace 100755
--- a/release/generate-release.sh
+++ b/release/generate-release.sh
@@ -3,14 +3,10 @@
# generate-release.sh: check out source trees, and build release components with
# totally clean, fresh trees.
#
-# Usage: generate-release.sh svn-branch scratch-dir
+# Usage: generate-release.sh [-r revision] [-d docrevision] \
+# [-p portsrevision] svn-branch scratch-dir
#
# Environment variables:
-# CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation
-# trees. This or CVSROOT must be set to include ports and documentation.
-# CVSROOT: CVS root to obtain the ports and documentation trees. This or
-# CVSUP_HOST must be set to include ports and documentation.
-# CVS_TAG: CVS tag for ports and documentation (HEAD by default)
# SVNROOT: SVN URL to FreeBSD source repository (by default,
# svn://svn.freebsd.org/base)
# MAKE_FLAGS: optional flags to pass to make (e.g. -j)
@@ -20,26 +16,42 @@
# $FreeBSD$
#
-mkdir -p $2/usr/src
+usage()
+{
+ echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir"
+ exit 1
+}
+
+REVISION=
+DOCREVISION=
+PORTSREVISION=
+while getopts d:r:p: opt; do
+ case $opt in
+ d)
+ DOCREVISION="-r $OPTARG"
+ ;;
+ r)
+ REVISION="-r $OPTARG"
+ ;;
+ p)
+ PORTSREVISION="-r $OPTARG"
+ ;;
+ \?)
+ usage
+ ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+if [ $# -lt 2 ]; then
+ usage
+fi
+
set -e # Everything must succeed
svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src
-if [ ! -z $CVSUP_HOST ]; then
- cat > $2/docports-supfile << EOF
- *default host=$CVSUP_HOST
- *default base=/var/db
- *default prefix=/usr
- *default release=cvs tag=${CVS_TAG:-.}
- *default delete use-rel-suffix
- *default compress
- ports-all
- doc-all
-EOF
-elif [ ! -z $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
-fi
+svn co ${SVNROOT:-svn://svn.freebsd.org/doc}/head $2/usr/doc $DOCREVISION
+svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION
cd $2/usr/src
make $MAKE_FLAGS buildworld
@@ -47,18 +59,11 @@ make installworld distribution DESTDIR=$2
mount -t devfs devfs $2/dev
trap "umount $2/dev" EXIT # Clean up devfs mount on exit
-if [ ! -z $CVSUP_HOST ]; then
- cp /etc/resolv.conf $2/etc/resolv.conf
-
- # Checkout ports and doc trees
- chroot $2 /usr/bin/csup /docports-supfile
-fi
-
if [ -d $2/usr/doc ]; then
cp /etc/resolv.conf $2/etc/resolv.conf
- # Build ports to build release documentation
- chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)'
+ # Install docproj to build release documentation
+ chroot $2 /bin/sh -c '(export ASSUME_ALWAYS_YES=1 && /usr/sbin/pkg install -y docproj) || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)'
fi
chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel