summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-09-30 16:32:14 +0200
committerHolger Levsen <holger@layer-acht.org>2014-09-30 16:32:14 +0200
commit489f94689557e6e20431ff223f2856af8d19b398 (patch)
tree306bf05cf0416b19091c93df5dfbf175fe2c5fb5
parentf70a3f0b10ed5bf1b3e564a66e42b26d849a3d28 (diff)
downloadjenkins.debian.net-489f94689557e6e20431ff223f2856af8d19b398.tar.xz
reproducible: better cleanup and better arch+version handling
-rwxr-xr-xbin/reproducible_build.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh
index 21bb74c9..1a8beaf8 100755
--- a/bin/reproducible_build.sh
+++ b/bin/reproducible_build.sh
@@ -55,8 +55,7 @@ EOF
# this needs sid entries in sources.list:
grep deb-src /etc/apt/sources.list | grep sid
# try apt-get update twice, else fail gracefully, aka not.
-sudo apt-get update || ( sleep $(( $RANDOM % 100 )) ; sudo apt-get update || true )
-
+sudo apt-get update || ( sleep $(( $RANDOM % 70 + 30 )) ; sudo apt-get update || true )
set +x
# if $1 is an integer, build $1 random packages
@@ -148,6 +147,7 @@ for SRCPACKAGE in ${PACKAGES} ; do
SKIPPED="${SRCPACKAGE} ${SKIPPED}"
continue
fi
+ rm -f ${SRCPACKAGE}_* > /dev/null 2>&1
# host has only sid in deb-src in sources.list
apt-get source --download-only --only-source ${SRCPACKAGE}
RESULT=$?
@@ -155,9 +155,10 @@ for SRCPACKAGE in ${PACKAGES} ; do
SOURCELESS="${SOURCELESS} ${SRCPACKAGE}"
echo "Warning: ${SRCPACKAGE} is not a source package, or was removed or renamed. Please investigate."
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"404\", \"$DATE\", \"\")"
+ continue
else
- VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| head -1 | cut -d ":" -f2-)
- ARCH=$(grep "^Architecture: " ${SRCPACKAGE}_*.dsc| cut -d ":" -f2)
+ VERSION=$(grep "^Version: " ${SRCPACKAGE}_*.dsc| sort -r | head -1 | cut -d ":" -f2-)
+ ARCH=$(grep "^Architecture: " ${SRCPACKAGE}_*.dsc| sort -r | head -1 | cut -d ":" -f2)
if [[ ! "$ARCH" =~ "amd64" ]] && [[ ! "$ARCH" =~ "all" ]] && [[ ! "$ARCH" =~ "any" ]] ; then
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"not for us\", \"$DATE\", \"\")"
echo "Package ${SRCPACKAGE} (${VERSION}) shall only be build on \"$ARCH\" and was thus skipped."
@@ -202,8 +203,9 @@ for SRCPACKAGE in ${PACKAGES} ; do
echo "Warning: ${SRCPACKAGE} failed to build from source."
sqlite3 -init $INIT ${PACKAGES_DB} "REPLACE INTO source_packages VALUES (\"${SRCPACKAGE}\", \"${VERSION}\", \"FTBFS\", \"$DATE\", \"\")"
mv ${SRCPACKAGE}_${EVERSION}.pbuilder.log /var/lib/jenkins/userContent/pbuilder/
- dcmd rm ${SRCPACKAGE}_${EVERSION}.dsc
fi
+ dcmd rm ${SRCPACKAGE}_${EVERSION}.dsc
+ rm -f ${SRCPACKAGE}_* > /dev/null 2>&1
fi
set +x