summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build.sh
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-04-06 00:31:58 +0200
committerHolger Levsen <holger@layer-acht.org>2015-04-18 17:20:08 +0200
commitb4d6ef23a889ec37b539bbc06311efe8a680bd96 (patch)
treebdc5108f498edadb9d36c86c0b5dce66c95ce0ad /bin/reproducible_build.sh
parent9f72321ebc1dc1c02788d194239185b858c0399b (diff)
downloadjenkins.debian.net-b4d6ef23a889ec37b539bbc06311efe8a680bd96.tar.xz
reproducible: build: refactor: more trimming of the main function + fix variable declaration order
Diffstat (limited to 'bin/reproducible_build.sh')
-rwxr-xr-xbin/reproducible_build.sh23
1 files changed, 11 insertions, 12 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 0947e285..5ba241fd 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -192,6 +192,8 @@ init() {
echo "============================================================================="
# mark build attempt
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO schedule (package_id, date_scheduled, date_build_started) VALUES ('$SRCPKGID', '$SCHEDULED_DATE', '$DATE');"
+ echo "Starting to build ${SRCPACKAGE}/${SUITE} on $DATE" | tee ${RBUILDLOG}
+ echo "The jenkins build log is/was available at $BUILD_URL/console" | tee -a ${RBUILDLOG}
}
get_source_package() {
@@ -216,26 +218,23 @@ TMPCFG=$(mktemp -t pbuilderrc_XXXX)
trap cleanup_all INT TERM EXIT
cd $TMPDIR
-# global variables (this is what we expect, at least. if something goes wrong, then something failed)
-RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_None.rbuild.log
-DBDREPORT=$(echo ${SRCPACKAGE}_${EVERSION}.debbindiff.html)
-BUILDINFO=${SRCPACKAGE}_${EVERSION}_${ARCH}.buildinfo
DATE=$(date +'%Y-%m-%d %H:%M')
START=$(date +'%s')
-
choose_package
+
+RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_None.rbuild.log
+DBDREPORT=$(echo ${SRCPACKAGE}_${EVERSION}.debbindiff.html)
+BUILDINFO=${SRCPACKAGE}_${EVERSION}_${ARCH}.buildinfo
+
init
+get_source_package
+
+VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| head -1 | egrep -v '(GnuPG v|GnuPG/MacGPG2)' | cut -d " " -f2-)
+EVERSION=$(echo $VERSION | cut -d ":" -f2) # EPOCH_FREE_VERSION was too long
- echo "Starting to build ${SRCPACKAGE}/${SUITE} on $DATE" | tee ${RBUILDLOG}
- echo "The jenkins build log is/was available at $BUILD_URL/console" | tee -a ${RBUILDLOG}
- set +e
- get_source_package
- VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| head -1 | egrep -v '(GnuPG v|GnuPG/MacGPG2)' | cut -d " " -f2-)
- # EPOCH_FREE_VERSION was too long
- EVERSION=$(echo $VERSION | cut -d ":" -f2)
# preserve RBUILDLOG as TMPLOG, then cleanup userContent from previous builds,
# and then access RBUILDLOG with it's correct name (=eversion)
TMPLOG=$(mktemp)