From f70e6c46f873812ca6a63a2b56a8175df5e80448 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 24 Sep 2014 01:02:59 +0200 Subject: reproducible: deal gracefully with build failures --- bin/reproducible_build.sh | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 0244ee14..1926554c 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -22,29 +22,30 @@ BAD="" for PACKAGE in "$@" ; do let "COUNT_TOTAL=COUNT_TOTAL+1" rm b1 b2 -rf - apt-get source --download-only ${PACKAGE} - sudo pbuilder --build --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc - mkdir b1 b2 - dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b1 - sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes - sudo pbuilder --build --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc - dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b2 - sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes - cat b1/${PACKAGE}_*.changes - TMPFILE=$(mktemp) - ./misc.git/diffp b1/*.changes b2/*.changes | tee ${TMPFILE} - if $(grep -qv '^\*\*\*\*\*' ${TMPFILE}) ; then - figlet ${PACKAGE} - echo - echo "${PACKAGE} build successfull." - let "COUNT_GOOD=COUNT_GOOD+1" - GOOD="${PACKAGE} ${GOOD}" - else - echo "Warning: ${PACKAGE} failed to build reproducible." - let "COUNT_BAD=COUNT_BAD+1" - GOOD="${PACKAGE} ${BAD}" + apt-get source --download-only ${PACKAGE} || true + if $(sudo pbuilder --build --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc) ; then + mkdir b1 b2 + dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b1 + sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes + sudo pbuilder --build --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc + dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b2 + sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes + cat b1/${PACKAGE}_*.changes + TMPFILE=$(mktemp) + ./misc.git/diffp b1/*.changes b2/*.changes | tee ${TMPFILE} + if $(grep -qv '^\*\*\*\*\*' ${TMPFILE}) ; then + figlet ${PACKAGE} + echo + echo "${PACKAGE} build successfull." + let "COUNT_GOOD=COUNT_GOOD+1" + GOOD="${PACKAGE} ${GOOD}" + else + echo "Warning: ${PACKAGE} failed to build reproducible." + let "COUNT_BAD=COUNT_BAD+1" + GOOD="${PACKAGE} ${BAD}" + fi + rm b1 b2 ${TMPFILE} -rf fi - rm b1 b2 ${TMPFILE} -rf echo "==============================================================" echo "$COUNT_TOTAL of ${#@} done." -- cgit v1.2.3-70-g09d2