svn commit: r235940 - projects/portbuild/scripts

Mark Linimon linimon at FreeBSD.org
Thu May 24 21:55:37 UTC 2012


Author: linimon (doc,ports committer)
Date: Thu May 24 21:55:36 2012
New Revision: 235940
URL: http://svn.freebsd.org/changeset/base/235940

Log:
   - Allow for per-build src.conf as ${builddir}/src.conf.server.
  
   - allow 'latest' to be assumed as an argument to makeworld and mkbindist.
  
   - standardize on 'builddir' instead of 'here'.
  
   - some formatting cleanup.

Modified:
  projects/portbuild/scripts/buildenv
  projects/portbuild/scripts/makeworld
  projects/portbuild/scripts/mkbindist

Modified: projects/portbuild/scripts/buildenv
==============================================================================
--- projects/portbuild/scripts/buildenv	Thu May 24 21:44:46 2012	(r235939)
+++ projects/portbuild/scripts/buildenv	Thu May 24 21:55:36 2012	(r235940)
@@ -135,6 +135,7 @@ buildenv () {
     # set make.conf.  Consumed by both 'make index' and 'makeworld'.
     # First, must explicitly _unset_ pointyhat's native one.
     export __MAKE_CONF=/dev/null
+
     # allow for per-build make.conf
     if [ -f ${builddir}/make.conf.server ]; then
 	export __MAKE_CONF=${builddir}/make.conf.server
@@ -145,6 +146,13 @@ buildenv () {
 #	    export __MAKE_CONF=${pbd}/${arch}/make.conf
 #	fi
     fi
+
+    # allow for per-build src.conf
+    if [ -f ${builddir}/src.conf.server ]; then
+	export SRCCONF=${builddir}/src.conf.server
+    else
+	export SRCCONF=/dev/null
+    fi
 }
 
 #

Modified: projects/portbuild/scripts/makeworld
==============================================================================
--- projects/portbuild/scripts/makeworld	Thu May 24 21:44:46 2012	(r235939)
+++ projects/portbuild/scripts/makeworld	Thu May 24 21:55:36 2012	(r235940)
@@ -4,26 +4,43 @@
 # XXX lockfile and interlock with mkbindist to avoid overlapping
 # builds
 
-if [ $# -lt 3 ]; then
-        echo "usage: makeworld arch branch buildid [args]"
-        exit 1
+if [ $# -lt 2 ]; then
+  echo "usage: makeworld <arch> <branch> [<buildid>] [args]"
+  exit 1
 fi
 
 arch=$1
 branch=$2
-buildid=$3
-shift 3
+shift 2
+
+buildid="latest"
+if [ $# -gt 0 ]; then
+  case "$1" in
+    -client)
+      ;;
+    -nocvs|-novcs)
+      ;;
+    *)
+      buildid="$1"
+      shift
+      ;;
+  esac
+fi
 
 pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
 pbd=${PORTBUILD_DATA:-/var/portbuild}
 
 builddir=${pbd}/${arch}/${branch}/builds/${buildid}
+if [ ! -d ${builddir} ]; then
+    echo "build directory ${builddir} does not exist!"
+    exit 1
+fi
 
 . ${pbc}/conf/server.conf
 . ${pbc}/conf/common.conf
 . ${pbd}/${arch}/portbuild.conf
-if [ -f ${pbd}/${arch}/${branch}/builds/${buildid}/portbuild.conf ]; then
-    . ${pbd}/${arch}/${branch}/builds/${buildid}/portbuild.conf
+if [ -f ${builddir}/portbuild.conf ]; then
+    . ${builddir}/portbuild.conf
 fi
 # NB: we can't use buildenv because it sets ARCH and MACHINE_ARCH that
 # confuses cross-builds
@@ -57,14 +74,23 @@ if [ "$client" = "1" ]; then
 	shift 1
 else
 	SRC_BASE=${builddir}/src
+
 	# allow for per-build make.conf
 	if [ -f ${builddir}/make.conf.server ]; then
 	    export __MAKE_CONF=${builddir}/make.conf.server
 	else
 	    export __MAKE_CONF=/dev/null
 	fi
+
+	# allow for per-build src.conf
+	if [ -f ${builddir}/src.conf.server ]; then
+	    export SRCCONF=${builddir}/src.conf.server
+	else
+	    export SRCCONF=/dev/null
+	fi
 fi
-cd ${SRC_BASE}
+
+cd ${SRC_BASE} || exit $?
 
 if [ "$novcs" = "0" ]; then
 	echo "==> Updating source tree"

Modified: projects/portbuild/scripts/mkbindist
==============================================================================
--- projects/portbuild/scripts/mkbindist	Thu May 24 21:44:46 2012	(r235939)
+++ projects/portbuild/scripts/mkbindist	Thu May 24 21:55:36 2012	(r235940)
@@ -3,7 +3,7 @@
 # XXX merge with makeworld?
 
 usage () {
-  echo "usage: mkbindist <arch> <branch> <buildid>"
+  echo "usage: mkbindist <arch> <branch> [<buildid>]"
   exit 1
 }
 
@@ -16,22 +16,33 @@ cleandir() {
     fi
 }
 
-if [ $# -lt 3 ]; then
+if [ $# -lt 2 ]; then
   usage
 fi
 
 arch=$1
 branch=$2
-buildid=$3
-shift 3
+shift 2
+ 
+buildid="latest"
+if [ $# -gt 0 ]; then
+    buildid="$1"
+    shift
+fi
 
 pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
 pbd=${PORTBUILD_DATA:-/var/portbuild}
 
+builddir=${pbd}/${arch}/${branch}/builds/${buildid}
+if [ ! -d ${builddir} ]; then
+    echo "build directory ${builddir} does not exist!"
+    exit 1
+fi
+ 
 . ${pbc}/conf/server.conf
 . ${pbd}/${arch}/portbuild.conf
-if [ -f ${pbd}/${arch}/${branch}/builds/${buildid}/portbuild.conf ]; then
-    . ${pbd}/${arch}/${branch}/builds/${buildid}/portbuild.conf
+if [ -f ${builddir}/portbuild.conf ]; then
+    . ${builddir}/portbuild.conf
 fi
 
 . ${pbc}/scripts/buildenv
@@ -41,13 +52,7 @@ if ! validate_env ${arch} ${branch}; the
     exit 1
 fi
 
-here=${pbd}/${arch}/${branch}/builds/${buildid}
-if [ ! -d ${here} ]; then
-    echo "Invalid build ID ${buildid}"
-    exit 1
-fi
-
-tmpdir=${here}/bindist/tmp
+tmpdir=${builddir}/bindist/tmp
 
 # Clean up ${tmpdir}
 cleandir ${tmpdir}
@@ -64,25 +69,25 @@ cd ${destdir}; find -dx . | \
 cd ${tmpdir}
 
 # Customize the tmpdir
-if [ -s "${here}/bindist/delete" ]; then
-  sed -e "s,^,${tmpdir}," ${here}/bindist/delete | xargs rm -rf
+if [ -s "${builddir}/bindist/delete" ]; then
+  sed -e "s,^,${tmpdir}," ${builddir}/bindist/delete | xargs rm -rf
 fi
-if [ -s "${here}/bindist/dirlist" ]; then
-  cat "${here}/bindist/dirlist" | xargs mkdir -p 
+if [ -s "${builddir}/bindist/dirlist" ]; then
+  cat "${builddir}/bindist/dirlist" | xargs mkdir -p 
 fi
 # XXX MCL seems to be obsoleted by individual files in clients/?
-if [ -d ${here}/bindist/files ]; then
-  cd ${here}/bindist/files; find -dx . | cpio -dump ${tmpdir}
+if [ -d ${builddir}/bindist/files ]; then
+  cd ${builddir}/bindist/files; find -dx . | cpio -dump ${tmpdir}
 fi
 
 # Post-processing of installed world
 date '+%Y%m%d' > ${tmpdir}/var/db/port.mkversion
 
 # Create the tarball
-tar cfCj ${here}/.bindist.tbz ${tmpdir} .
-mv -f ${here}/.bindist.tbz ${here}/bindist.tbz
-md5 ${here}/bindist.tbz > ${here}/bindist.tbz.md5
+tar cfCj ${builddir}/.bindist.tbz ${tmpdir} .
+mv -f ${builddir}/.bindist.tbz ${builddir}/bindist.tbz
+md5 ${builddir}/bindist.tbz > ${builddir}/bindist.tbz.md5
 
 # Clean up
-cd ${here}
+cd ${builddir}
 cleandir ${tmpdir}


More information about the svn-src-projects mailing list