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]

Reviewed by:	nwhitehorn
Approved by:	nwhitehorn
Enhanced by:	glebius [1]
MFC After:	1 week
X-MFC-To:	9-only
This commit is contained in:
gjb 2012-09-17 02:23:03 +00:00
parent 3f1029eaf4
commit c800eaacb8

View File

@ -23,16 +23,24 @@
usage()
{
echo "Usage: $0 [-r revision] svn-branch scratch-dir"
echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir"
exit 1
}
REVISION=
while getopts r: opt; do
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
;;
@ -57,22 +65,8 @@ esac
mkdir -p $2/usr/src
svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src $REVISION
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
@ -80,18 +74,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