[Reproducible-commits] [misc] 01/01: add support for cowbuilder

Ximin Luo infinity0 at pwned.gg
Wed Jan 14 13:10:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0-guest pushed a commit to branch master
in repository misc.

commit f85d6811da29d54a4cc445cfe4794d1210986060
Author: Ximin Luo <infinity0 at pwned.gg>
Date:   Wed Jan 14 14:06:32 2015 +0100

    add support for cowbuilder
---
 prebuilder/rebuild.sh | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/prebuilder/rebuild.sh b/prebuilder/rebuild.sh
index d2be241..91690a2 100755
--- a/prebuilder/rebuild.sh
+++ b/prebuilder/rebuild.sh
@@ -1,11 +1,35 @@
 #!/bin/sh
 
+BASEPATH="/var/cache/pbuilder/base-reproducible.tgz"
+COWBUILDER=false
+SCRIPT_DIR="$(dirname "$0")"
+
+while getopts b:c o; do
+	case $o in
+	b )	BASEPATH="$OPTARG"
+		[ "${BASEPATH%.cow}" != "${BASEPATH}" ] && COWBUILDER=true
+		;;
+	c )	COWBUILDER=true;;
+	esac
+done
+shift "$(expr $OPTIND - 1)"
+
+sudo_pbuilder() {
+	local cmd="$1"
+	shift
+	if $COWBUILDER; then
+		sudo $SUDO_ENV cowbuilder "$cmd" --basepath "$BASEPATH" "$@"
+	else
+		sudo $SUDO_ENV pbuilder "$cmd" --basetgz "$BASEPATH" "$@"
+	fi
+}
+
 PACKAGE="$1"
 
 rm -r b1 b2
 mkdir -p b1 b2 logs
 
-sudo DEB_BUILD_OPTIONS=nocheck pbuilder --build --debbuildopts '-b' --logfile logs/${PACKAGE}.build1 --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc
+SUDO_ENV="DEB_BUILD_OPTIONS=nocheck" sudo_pbuilder --build --debbuildopts '-b' --logfile logs/${PACKAGE}.build1 ${PACKAGE}_*.dsc
 xz < logs/${PACKAGE}.build1 > logs/${PACKAGE}.build1.xz
 dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b1
 sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes
@@ -16,7 +40,7 @@ TMPTAR="$TMPDIR/initial_build.tar"
 
 (cd b1 && tar -cf "$TMPTAR" $(dcmd ${PACKAGE}_*.changes))
 
-sudo INPUTFILE="$TMPTAR" DEB_BUILD_OPTIONS=nocheck pbuilder --build --debbuildopts '-b' --logfile logs/${PACKAGE}.build2 --basetgz /var/cache/pbuilder/base-reproducible.tgz --hookdir pbuilderhooks ${PACKAGE}_*.dsc
+SUDO_ENV="DEB_BUILD_OPTIONS=nocheck" sudo_pbuilder --build --debbuildopts '-b' --logfile logs/${PACKAGE}.build2 --hookdir "$SCRIPT_DIR/pbuilderhooks" --inputfile "$TMPTAR" ${PACKAGE}_*.dsc
 xz < logs/${PACKAGE}.build2 > logs/${PACKAGE}.build2.xz
 dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b2
 sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list