diff options
author | Holger Levsen <holger@layer-acht.org> | 2014-10-08 11:44:40 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-10-08 11:44:40 +0200 |
commit | 78a65c6335b43464227448c73742afe4828686f7 (patch) | |
tree | 5938561084a4c78d4ba225bf321f0579116f051c /bin | |
parent | b18b8fab77896e2bae12a904e7a6f35a688f823c (diff) | |
download | jenkins.debian.net-78a65c6335b43464227448c73742afe4828686f7.tar.xz |
reproducible: properly cleanup all logfiles
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_build.sh | 8 |
1 files changed, 5 insertions, 3 deletions
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\")" |