summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reproducible_build.sh16
-rwxr-xr-xbin/reproducible_common.sh3
-rwxr-xr-xbin/reproducible_coreboot.sh1
3 files changed, 12 insertions, 8 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
#
diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh
index 84df5d85..b0db0803 100755
--- a/bin/reproducible_common.sh
+++ b/bin/reproducible_common.sh
@@ -41,6 +41,8 @@ JENKINS_URL=${JENKINS_URL:0:-1}
SUITES="testing unstable experimental"
# arches being tested
ARCHES="amd64"
+# number of cores to be used
+NUM_CPU=$(grep -c '^processor' /proc/cpuinfo)
# existing usertags
USERTAGS="toolchain infrastructure timestamps fileordering buildpath username hostname uname randomness buildinfo cpu signatures environment umask"
@@ -270,7 +272,6 @@ write_explaination_table() {
write_page "<tr><td>env LANG</td><td>LANG=\"en_GB.UTF-8\"</td><td>LANG=\"fr_CH.UTF-8\"</td></tr>"
write_page "<tr><td>env LC_ALL</td><td><em>unset</em></td><td>LC_ALL=\"fr_CH.UTF-8\"</td></tr>"
write_page "<tr><td>env PATH</td><td>PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:\"</td><td>PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path\"</td></tr>"
- local NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l)
if [ "$1" = "debian" ] ; then
write_page "<tr><td>env BUILDUSERID</td><td>BUILDUSERID=\"1111\"</td><td>BUILDUSERID=\"2222\"</td></tr>"
write_page "<tr><td>env BUILDUSERNAME</td><td>BUILDUSERNAME=\"pbuilder1\"</td><td>BUILDUSERNAME=\"pbuilder2\"</td></tr>"
diff --git a/bin/reproducible_coreboot.sh b/bin/reproducible_coreboot.sh
index 2e8d0f44..c39771cf 100755
--- a/bin/reproducible_coreboot.sh
+++ b/bin/reproducible_coreboot.sh
@@ -91,7 +91,6 @@ COREBOOT_VERSION=$(git describe)
echo "This is coreboot $COREBOOT_VERSION."
echo
git log -1
-NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l)
echo "============================================================================="
echo "$(date -u) - Building cross compilers for ${ARCHS} now."