From owner-svn-src-projects@FreeBSD.ORG Thu May 24 21:55:37 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5143C106564A; Thu, 24 May 2012 21:55:37 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1F68FC0A; Thu, 24 May 2012 21:55:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4OLtbkm062569; Thu, 24 May 2012 21:55:37 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4OLtbnq062565; Thu, 24 May 2012 21:55:37 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201205242155.q4OLtbnq062565@svn.freebsd.org> From: Mark Linimon Date: Thu, 24 May 2012 21:55:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235940 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2012 21:55:37 -0000 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 [] [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 " + echo "usage: mkbindist []" 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}