[26850] in Source-Commits
/svn/athena r25792 - in trunk/debathena/scripts: . build-server/build-all
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Oct 30 11:22:39 2012
Date: Tue, 30 Oct 2012 11:22:32 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201210301522.q9UFMWrP016026@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2012-10-30 11:22:32 -0400 (Tue, 30 Oct 2012)
New Revision: 25792
Modified:
trunk/debathena/scripts/build-server/build-all/do-build
trunk/debathena/scripts/chroot-sources
trunk/debathena/scripts/daschroot
trunk/debathena/scripts/sbuildhack
Log:
Update for sbuild 0.62.6:
- sbuild no longer passes its configuration as environment variables
(e.g. SBUILD_BUILD_CONF_DISTRIBUTION). Replace this functionality with
our own variable, DEBATHENA_BUILD_DIST
- update chroot-sources to use DEBATHENA_BUILD_DIST and fallback to
guessing intelligently, rather than constructing invalid sources.list
files
- update sbuildhack to set the new environment variable (this also requires
that the variable be filtered in ~/.sbuildrc)
- update daschroot and do-build to set the new environment variable instead
of the old one.
Modified: trunk/debathena/scripts/build-server/build-all/do-build
===================================================================
--- trunk/debathena/scripts/build-server/build-all/do-build 2012-10-25 15:45:18 UTC (rev 25791)
+++ trunk/debathena/scripts/build-server/build-all/do-build 2012-10-30 15:22:32 UTC (rev 25792)
@@ -57,7 +57,7 @@
# Build the .dsc if necessary.
if ! [ -e "$dsc" ]; then
if ! [ -e "${package}_$version.dsc" ]; then
- schroot -c "${psuite}-amd64-sbuild" -u root -- sh -ec "SBUILD_BUILD_CONF_DISTRIBUTION=$psuite $(readlink -f /mit/debathena/bin/chroot-sources) && apt-get update && apt-get source $package"
+ schroot -c "${psuite}-amd64-sbuild" -u root -- sh -ec "DEBATHENA_BUILD_DIST=$psuite $(readlink -f /mit/debathena/bin/chroot-sources) && apt-get update && apt-get source $package"
fi
if ! ([ -e "${package}_${version}_source.changes" ] || [ -e "${package}_${version}_amd64.changes" ] || [ -e "${package}_${version}_i386.changes" ]); then
(cd "${package}-${version/-*/}" && dpkg-genchanges -S -sa >"../${package}_${version}_source.changes")
Modified: trunk/debathena/scripts/chroot-sources
===================================================================
--- trunk/debathena/scripts/chroot-sources 2012-10-25 15:45:18 UTC (rev 25791)
+++ trunk/debathena/scripts/chroot-sources 2012-10-30 15:22:32 UTC (rev 25792)
@@ -7,10 +7,34 @@
# "-proposed", or "-development"),
#
# If DEBATHENA_RELEASE is unset, assume we're building out of -development.
+# DEBATHENA_BUILD_DIST is the target build distribution. Note:
+# SBUILD_BUILD_CONF_DISTRIBUTION is not set as of sbuild 0.60.6 or
+# later. An environment_filter in ~/.sbuildrc must be configured to
+# allow passing of this variable.
: ${DEBATHENA_RELEASE=-development}
: ${DEBATHENA_MIRROR:=http://debathena.mit.edu/apt}
-dist="$SBUILD_BUILD_CONF_DISTRIBUTION"
+: ${DEBATHENA_BUILD_DIST:="$SBUILD_BUILD_CONF_DISTRIBUTION"}
+if [ -z "$DEBATHENA_BUILD_DIST" ]; then
+ echo "Warning: DEBATHENA_BUILD_DIST is unset or empty!" >&2
+ if [ -r /etc/lsb-release ]; then
+ echo "Attempting to guess dist from lsb-release..." >&2
+ . /etc/lsb-release
+ if [ -n "$DISTRIB_CODENAME" ]; then
+ DEBATHENA_BUILD_DIST="$DISTRIB_CODENAME"
+ fi
+ fi
+ if [ -z "$DEBATHENA_BUILD_DIST" ] && echo "$SCHROOT_CHROOT_NAME" | \
+ egrep -q "^[a-z]+-(amd64|i386)-sbuild$"; then
+ echo "Attempting to guess dist from chroot name..." >&2
+ DEBATHENA_BUILD_DIST=$(echo "$SCHROOT_CHROOT_NAME" | cut -d\- -f 1)
+ fi
+fi
+if [ -z "$DEBATHENA_BUILD_DIST" ]; then
+ echo "*** ERROR: Cannot determine distribution to build. Stop." >&2
+ exit 1
+fi
+dist="$DEBATHENA_BUILD_DIST"
list=/etc/apt/sources.list.d/debathena.list
rm -f "$list"
Modified: trunk/debathena/scripts/daschroot
===================================================================
--- trunk/debathena/scripts/daschroot 2012-10-25 15:45:18 UTC (rev 25791)
+++ trunk/debathena/scripts/daschroot 2012-10-30 15:22:32 UTC (rev 25792)
@@ -17,7 +17,7 @@
fi
session=$(schroot -c "$dist-$arch-sbuild" -b)
-schroot -c "$session" -r -u root -- env SBUILD_BUILD_CONF_DISTRIBUTION="$dist" "$(readlink -f "$DA_SCRIPTS_DIR/chroot-sources")"
+schroot -c "$session" -r -u root -- env DEBATHENA_BUILD_DIST="$dist" "$(readlink -f "$DA_SCRIPTS_DIR/chroot-sources")"
if [ "$#" -gt 0 ]; then
echo "I: Entering schroot session $session"
fi
Modified: trunk/debathena/scripts/sbuildhack
===================================================================
--- trunk/debathena/scripts/sbuildhack 2012-10-25 15:45:18 UTC (rev 25791)
+++ trunk/debathena/scripts/sbuildhack 2012-10-30 15:22:32 UTC (rev 25792)
@@ -28,6 +28,7 @@
exit
fi
+env DEBATHENA_BUILD_DIST="$dist" \
sbuild --append-to-version=`gettag "$dist"` \
-d "$dist" --arch="$arch" \
--apt-update --apt-distupgrade \