Discussion:
svn commit: r219788 - head/release
(too old to reply)
Nathan Whitehorn
2011-03-19 23:06:18 UTC
Permalink
Author: nwhitehorn
Date: Sat Mar 19 23:06:17 2011
New Revision: 219788
URL: http://svn.freebsd.org/changeset/base/219788

Log:
Add support for checking out ports and doc trees from a CVS repository,
in addition to CVSUP, and add support for alternate SVN roots for src.

Requested by: jhb

Modified:
head/release/generate-release.sh

Modified: head/release/generate-release.sh
==============================================================================
--- head/release/generate-release.sh Sat Mar 19 22:36:59 2011 (r219787)
+++ head/release/generate-release.sh Sat Mar 19 23:06:17 2011 (r219788)
@@ -7,8 +7,12 @@
#
# Environment variables:
# CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation
-# trees. Must be set to include ports and documentation.
-# CVSUP_TAG: CVS tag for ports and documentation (HEAD by default)
+# 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)
#
# Note: Since this requires a chroot, release cross-builds will not work!
@@ -17,20 +21,22 @@
#

mkdir -p $2/usr/src
-svn co svn://svn.freebsd.org/base/$1 $2/usr/src || exit 1
+svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src || exit 1
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=${CVSUP_TAG:-.}
+ *default release=cvs tag=${CVS_TAG:-.}
*default delete use-rel-suffix
*default compress
ports-all
doc-all
EOF
-else
- RELEASE_FLAGS="-DNOPORTS -DNODOC"
+elif [ ! -z $CVSROOT ]; then
+ cd $2/usr
+ cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports || exit 1
+ cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc || exit 1
fi

cd $2/usr/src
@@ -43,6 +49,10 @@ if [ ! -z $CVSUP_HOST ]; then

# Checkout ports and doc trees
chroot $2 /usr/bin/csup /docports-supfile || exit 1
+fi
+
+if [ -d $2/usr/doc ]; then
+ cp /etc/resolv.conf $2/etc/resolv.conf

# Build ports to build the docs, then build the docs
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)' || exit 1
@@ -50,7 +60,7 @@ if [ ! -z $CVSUP_HOST ]; then
fi

chroot $2 /bin/sh -c "cd /usr/src && make $MAKE_FLAGS buildworld buildkernel" || exit 1
-chroot $2 /bin/sh -c "cd /usr/src/release && make obj release $RELEASE_FLAGS" || exit 1
+chroot $2 /bin/sh -c "cd /usr/src/release && make obj release" || exit 1
mkdir $2/R
cp -pRP $2/usr/obj/usr/src/release/release.iso $2/usr/obj/usr/src/release/memstick $2/usr/obj/usr/src/release/ftp $2/R
Garrett Cooper
2011-03-19 23:10:40 UTC
Permalink
On Sat, Mar 19, 2011 at 4:06 PM, Nathan Whitehorn
Post by Nathan Whitehorn
Author: nwhitehorn
Date: Sat Mar 19 23:06:17 2011
New Revision: 219788
URL: http://svn.freebsd.org/changeset/base/219788
 Add support for checking out ports and doc trees from a CVS repository,
 in addition to CVSUP, and add support for alternate SVN roots for src.
 Requested by: jhb
Although this seems good and all, wouldn't it make sense to split off
the pulling infrastructure into separate scripts so that someone could
have hooks to do:

- pre-pull (create paths, whatever)
- pull
- post-pull (patch?)

That way someone could choose any arbitrary SCM (git, hg, etc),
specify necessary configuration files, and apply local patches as
necessary.
Thanks,
-Garrett
Nathan Whitehorn
2011-03-19 23:17:30 UTC
Permalink
Post by Garrett Cooper
On Sat, Mar 19, 2011 at 4:06 PM, Nathan Whitehorn
Post by Nathan Whitehorn
Author: nwhitehorn
Date: Sat Mar 19 23:06:17 2011
New Revision: 219788
URL: http://svn.freebsd.org/changeset/base/219788
Add support for checking out ports and doc trees from a CVS repository,
in addition to CVSUP, and add support for alternate SVN roots for src.
Requested by: jhb
Although this seems good and all, wouldn't it make sense to split off
the pulling infrastructure into separate scripts so that someone could
- pre-pull (create paths, whatever)
- pull
- post-pull (patch?)
That way someone could choose any arbitrary SCM (git, hg, etc),
specify necessary configuration files, and apply local patches as
necessary.
Thanks,
-Garrett
That's pretty much the point of having generate-release.sh be a
different thing from 'make release'. You'll note that the script is very
short (36 lines of code, a good chunk of which are an inline supfile),
and could easily be adapted to suit any SCM. All it does is:

1. Check out source code
2. Build and install world into a chroot
3. Optionally check out doc/ports and install docproj ports
4. Run make release in the chroot

The regular make release stuff only cares that src(/doc/ports) have
shown up somehow on the host system and is well suited to the local
patches or nonstandard SCM case.
-Nathan

Loading...