summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-10-05 15:58:19 +0200
committerHolger Levsen <holger@layer-acht.org>2014-10-05 15:58:19 +0200
commit1dea5810ff5e43d8008b69ca75efa59ea960d0d8 (patch)
treed98b4a412387353c27dfcc8c1097276a8e03c3d8
parente3a60066faf64fb231b241c7d2d5285db7a5e597 (diff)
downloadjenkins.debian.net-1dea5810ff5e43d8008b69ca75efa59ea960d0d8.tar.xz
reproducible: collect rbuild.log from the complete build
-rwxr-xr-xbin/reproducible_build.sh22
-rwxr-xr-xbin/reproducible_stats.sh5
2 files changed, 22 insertions, 5 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 7a9d21bb..565c3177 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -15,7 +15,7 @@ if [ ! -f $PACKAGES_DB ] ; then
fi
# create dirs for results
-mkdir -p /var/lib/jenkins/userContent/dbd/ /var/lib/jenkins/userContent/buildinfo/ /var/lib/jenkins/userContent/pbuilder/
+mkdir -p /var/lib/jenkins/userContent/dbd/ /var/lib/jenkins/userContent/buildinfo/ /var/lib/jenkins/userContent/pbuilder/ /var/lib/jenkins/userContent/rbuild/
# this needs sid entries in sources.list:
grep deb-src /etc/apt/sources.list | grep sid
@@ -94,6 +94,11 @@ cleanup_userContent() {
rm -f /var/lib/jenkins/userContent/dbd/${SRCPACKAGE}_*.diffp.log > /dev/null 2>&1
rm -f /var/lib/jenkins/userContent/dbd/${SRCPACKAGE}_*.debbindiff.html > /dev/null 2>&1
rm -f /var/lib/jenkins/userContent/buildinfo/${SRCPACKAGE}_*.buildinfo > /dev/null 2>&1
+ rm -f /var/lib/jenkins/userContent/rbuild/${SRCPACKAGE}_*.rbuild.log > /dev/null 2>&1
+}
+
+move_rbuildlog() {
+ mv ${RBUILDLOG} /var/lib/jenkins/userContent/rbuild/
}
TMPDIR=$(mktemp --tmpdir=$PWD -d)
@@ -129,17 +134,23 @@ for SRCPACKAGE in ${PACKAGES} ; do
continue
fi
rm -f ${SRCPACKAGE}_* > /dev/null 2>&1
+ RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SRCPACKAGE}_None.rbuild.log
# host has only sid in deb-src in sources.list
- apt-get source --download-only --only-source ${SRCPACKAGE}
+ apt-get source --download-only --only-source ${SRCPACKAGE} > ${RBUILDLOG} 2>&1
RESULT=$?
if [ $RESULT != 0 ] ; then
SOURCELESS="${SOURCELESS} ${SRCPACKAGE}"
- sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"404\", \"$DATE\")"
+ sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"None\", \"404\", \"$DATE\")"
set +x
echo "Warning: ${SRCPACKAGE} is not a source package, or was removed or renamed. Please investigate."
+ move_rbuildlog
continue
else
VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| grep -v "GnuPG v" | sort -r | head -1 | cut -d " " -f2-)
+ TMPLOG=$(mktemp)
+ mv ${RBUILDLOG} ${TMPLOG}
+ RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SRCPACKAGE}_${EVERSION}.rbuild.log
+ mv ${TMPLOG} ${RBUILDLOG}
ARCH=$(grep "^Architecture: " ${SRCPACKAGE}_*.dsc| sort -r | head -1 | cut -d " " -f2-)
if [[ ! "$ARCH" =~ "amd64" ]] && [[ ! "$ARCH" =~ "all" ]] && [[ ! "$ARCH" =~ "any" ]] && [[ ! "$ARCH" =~ "linux-amd64" ]]; then
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"not for us\", \"$DATE\")"
@@ -147,10 +158,12 @@ for SRCPACKAGE in ${PACKAGES} ; do
let "COUNT_SKIPPED=COUNT_SKIPPED+1"
SKIPPED="${SRCPACKAGE} ${SKIPPED}"
continue
+ move_rbuildlog
fi
# EPOCH_FREE_VERSION was too long
EVERSION=$(echo $VERSION | cut -d ":" -f2)
sudo DEB_BUILD_OPTIONS="parallel=$NUM_CPU" pbuilder --build --debbuildopts "-b" --basetgz /var/cache/pbuilder/base-reproducible.tgz --distribution sid ${SRCPACKAGE}_*.dsc | tee ${SRCPACKAGE}_${EVERSION}.pbuilder.log
+ cat ${SRCPACKAGE}_${EVERSION}.pbuilder.log >> ${RBUILDLOG}
if [ -f /var/cache/pbuilder/result/${SRCPACKAGE}_${EVERSION}_amd64.changes ] ; then
mkdir b1 b2
dcmd cp /var/cache/pbuilder/result/${SRCPACKAGE}_${EVERSION}_amd64.changes b1
@@ -161,7 +174,7 @@ for SRCPACKAGE in ${PACKAGES} ; do
dcmd cp /var/cache/pbuilder/result/${SRCPACKAGE}_${EVERSION}_amd64.changes b2
sudo dcmd rm /var/cache/pbuilder/result/${SRCPACKAGE}_${EVERSION}_amd64.changes
set -e
- cat b1/${SRCPACKAGE}_${EVERSION}_amd64.changes
+ cat b1/${SRCPACKAGE}_${EVERSION}_amd64.changes | tee ${RBUILDLOG}
LOGFILE=$(ls ${SRCPACKAGE}_${EVERSION}.dsc)
LOGFILE=$(echo ${LOGFILE%.dsc}.debbindiff.html)
BUILDINFO=${SRCPACKAGE}_${EVERSION}_amd64.buildinfo
@@ -202,6 +215,7 @@ for SRCPACKAGE in ${PACKAGES} ; do
set -x
dcmd rm ${SRCPACKAGE}_${EVERSION}.dsc
rm -f ${SRCPACKAGE}_* > /dev/null 2>&1
+ move_rbuildlog
fi
set +x
diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh
index b6e99785..0a4601b2 100755
--- a/bin/reproducible_stats.sh
+++ b/bin/reproducible_stats.sh
@@ -48,7 +48,7 @@ link_packages() {
# remove epoch
EVERSION=$(echo $VERSION | cut -d ":" -f2)
htmlecho $PKG
- if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] || [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.diffp.log" ] || [ -f "/var/lib/jenkins/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log" ] || [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then
+ if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] || [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.diffp.log" ] || [ -f "/var/lib/jenkins/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log" ] || [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] || [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ]; then
htmlecho "<font size='-2'> ("
if [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then
htmlecho " <a href=\"$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo\">buildinfo</a> "
@@ -58,6 +58,9 @@ link_packages() {
elif [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.diffp.log" ] ; then
htmlecho " <a href=\"$JENKINS_URL/userContent/dbd/${PKG}_${EVERSION}.diffp.log\">diffp</a> "
fi
+ if [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ] ; then
+ htmlecho " <a href=\"$JENKINS_URL/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log\">rbuild</a> "
+ fi
if [ -f "/var/lib/jenkins/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log" ] ; then
htmlecho " <a href=\"$JENKINS_URL/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log\">pbuilder</a> "
fi