From 78a65c6335b43464227448c73742afe4828686f7 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 8 Oct 2014 11:44:40 +0200 Subject: reproducible: properly cleanup all logfiles --- bin/reproducible_build.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 2978282b..e2e6df1e 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -91,6 +91,7 @@ cleanup_all() { } cleanup_userContent() { + rm -f /var/lib/jenkins/userContent/rbuild/${SRCPACKAGE}_*.rbuild.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 } @@ -98,7 +99,6 @@ cleanup_userContent() { cleanup_prebuild() { rm b1 b2 -rf rm -f ${SRCPACKAGE}_* > /dev/null 2>&1 - rm -f /var/lib/jenkins/userContent/rbuild/${SRCPACKAGE}_*.rbuild.log > /dev/null 2>&1 } TMPDIR=$(mktemp --tmpdir=$PWD -d) @@ -147,10 +147,14 @@ for SRCPACKAGE in ${PACKAGES} ; do VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| grep -v "GnuPG v" | sort -r | head -1 | 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) mv ${RBUILDLOG} ${TMPLOG} + cleanup_userContent RBUILDLOG=/var/lib/jenkins/userContent/rbuild/${SRCPACKAGE}_${EVERSION}.rbuild.log mv ${TMPLOG} ${RBUILDLOG} + # check whether the package is not for us... 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\")" @@ -178,7 +182,6 @@ for SRCPACKAGE in ${PACKAGES} ; do echo "$(date) - debbindiff.py was killed after running into timeouot..." >> ${RBUILDLOG} fi if [ ! -f ./${LOGFILE} ] && [ -f b1/${BUILDINFO} ] ; then - cleanup_userContent cp b1/${BUILDINFO} /var/lib/jenkins/userContent/buildinfo/ figlet ${SRCPACKAGE} echo @@ -187,7 +190,6 @@ for SRCPACKAGE in ${PACKAGES} ; do let "COUNT_GOOD=COUNT_GOOD+1" GOOD="${SRCPACKAGE} ${GOOD}" else - cleanup_userContent cp b1/${BUILDINFO} /var/lib/jenkins/userContent/buildinfo/ || true mv ./${LOGFILE} /var/lib/jenkins/userContent/dbd/ || true sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"unreproducible\", \"$DATE\")" -- cgit v1.2.3-70-g09d2