summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-06-11 19:31:47 +0200
committerHolger Levsen <holger@layer-acht.org>2015-06-11 19:31:47 +0200
commit53bf0e766988c9fa6e6f2d2db15bd2927667fab6 (patch)
tree3599ad69aba84f38e22e6e46b1002c909950fe40 /bin/reproducible_build.sh
parentc25b533d22ad666c08a20d84285212b6fd3c88ee (diff)
downloadjenkins.debian.net-53bf0e766988c9fa6e6f2d2db15bd2927667fab6.tar.xz
reproducible: refactor
Diffstat (limited to 'bin/reproducible_build.sh')
-rwxr-xr-xbin/reproducible_build.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 539d4ecb..8aee48a3 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -372,11 +372,8 @@ check_suitability() {
if ! $SUITABLE ; then handle_not_for_us $ARCHITECTURES ; fi
}
-build_rebuild() {
- FTBFS=1
+first_build(){
local TMPCFG=$(mktemp -t pbuilderrc_XXXX --tmpdir=$TMPDIR)
- local NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l)
- mkdir b1 b2
set -x
printf "BUILDUSERID=1111\nBUILDUSERNAME=pbuilder1\n" > $TMPCFG
( timeout -k 12h 12h nice ionice -c 3 sudo \
@@ -390,6 +387,13 @@ build_rebuild() {
${SRCPACKAGE}_*.dsc \
) 2>&1 | tee -a $RBUILDLOG
if ! "$DEBUG" ; then set +x ; fi
+ rm $TMPCFG
+}
+
+build_rebuild() {
+ FTBFS=1
+ mkdir b1 b2
+ first_build
if [ -f b1/${SRCPACKAGE}_${EVERSION}_${ARCH}.changes ] ; then
# the first build did not FTBFS, try rebuild it.
check_for_race_conditions
@@ -397,6 +401,7 @@ build_rebuild() {
echo "Re-building ${SRCPACKAGE}/${VERSION} in ${SUITE} on ${ARCH} now."
echo "============================================================================="
set -x
+ local TMPCFG=$(mktemp -t pbuilderrc_XXXX --tmpdir=$TMPDIR)
printf "BUILDUSERID=2222\nBUILDUSERNAME=pbuilder2\n" > $TMPCFG
( timeout -k 12h 12h nice ionice -c 3 sudo \
DEB_BUILD_OPTIONS="parallel=$(echo $NUM_CPU-1|bc)" \
@@ -421,14 +426,13 @@ build_rebuild() {
else
echo "The second build failed, even though the first build was successful." | tee -a ${RBUILDLOG}
fi
+ rm $TMPCFG
fi
cleanup_userContent
update_rbuildlog
- rm $TMPCFG
if [ $FTBFS -eq 1 ] ; then handle_ftbfs ; fi
}
-
#
# below is what controls the world
#