[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian rebuilder 'thing': add support for dealing with epochs and...

Holger Levsen gitlab at salsa.debian.org
Thu May 7 23:18:34 BST 2020



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
c37ad851 by Holger Levsen at 2020-05-08T00:18:24+02:00
reproducible Debian rebuilder 'thing': add support for dealing with epochs and provide simple test cases

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/reproducible_debian_rebuilder_prototype.sh


Changes:

=====================================
bin/reproducible_debian_rebuilder_prototype.sh
=====================================
@@ -54,7 +54,9 @@ set_poolpath() {
 # define what to rebuild
 #
 
-# we want packages in bullseye first
+#
+# find a random package in bullseye
+#
 ARCH=amd64
 SUITE=bullseye
 DISTNAME="$SUITE-$ARCH"
@@ -63,7 +65,14 @@ SOURCES=$(ls $CHPATH/$DISTNAME/var/lib/apt/lists/*_dists_${SUITE}_main_source_So
 BINARY_PKG=$(grep-available . -s Package $PACKAGES | sort -R | head -1 | cut -d ' ' -f2)
 PKG=$( ( grep-available -X -S $BINARY_PKG -s Package $SOURCES || grep-available -X -P $BINARY_PKG -s Source $PACKAGES ) | cut -d ' ' -f2)
 VERSION=$(grep-available -X -S $PKG -s Version $SOURCES | head -1 | cut -d ' ' -f2)
+
+#
+# hardcoded test cases
+#
+PKG=libofx	; BINARY_PKG=libofx-dev 	;	VERSION=1:0.9.15-3	# has an epoch, see job #94
+
 output_echo "let's try to rebuild $BINARY_PKG from src:$PKG ($VERSION) from $SUITE/$ARCH"
+EVERSION="$(echo $VERSION | cut -d ':' -f2)"  # EPOCH_FREE_VERSION is too long
 
 # query .buildinfo file path (for that $PKG and $VERSION from bullseye...) from builtin-pho db
 BUILTINPHOPATH=$(psql -A -t -c "SELECT path FROM builds WHERE source='$PKG' AND source_version='$VERSION' AND ( arch_amd64=true OR arch_all=true ) LIMIT 1" buildinfo)
@@ -91,9 +100,10 @@ set_poolpath $PKG      # so we can set it here with a function
 FTPMASTERPATH="$(echo $BUILTINPHOPATH | cut -d '/' -f2-4)"
 URLPATH="https://buildinfos.debian.net/ftp-master.debian.org/buildinfo/$FTPMASTERPATH"
 
-if [ "$VERSION" != "$BINARY_VERSION" ] ; then
+if [ "$VERSION" != "$BINARY_VERSION" ] && [ "$EVERSION" != "$BINARY_VERSION" ] ; then
 	output_echo "Warning: .buildinfo file known for $PKG and $VERSION is $URL_PATH/$FILE: this indicates a binNMU because $VERSION != $BINARY_VERSION."
-	# TODO: what about packages with an epoch?
+elif [ "$VERSION" != "$EVERSION" ] ; then
+	: # package has an epoch
 fi
 
 # FIXME: we need locking to enable concurrent job runs
@@ -131,8 +141,8 @@ cp $FILE $FILE.orig
 output_echo "fetching source package $PKG ($VERSION)"
 # just download the source, don't verify it. (keys will expire and be removed from the keyrings)
 # FIXME: debrebuild should download the source code too (--optionally) and verify it matches the one described in .buildinfo file. -> file another wishlist bug.
-dget --download-only --allow-unauthenticated https://deb.debian.org/debian/pool/main/$POOLPATH/$PKG/${PKG}_$VERSION.dsc
-dscverify ${PKG}_$VERSION.dsc || echo "Warning: failed to verify signature, continueing anyway."
+dget --download-only --allow-unauthenticated https://deb.debian.org/debian/pool/main/$POOLPATH/$PKG/${PKG}_$EVERSION.dsc
+dscverify ${PKG}_$EVERSION.dsc || echo "Warning: failed to verify signature, continueing anyway."
 
 # prepare rebuild command
 DEBREBUILD=$(mktemp -t debrebuild-cmd.XXXXXXXX)
@@ -194,6 +204,8 @@ ls -lart
 output_echo "Diff between .buildinfo files:"
 diff $FILE.orig $FILE || true
 output_echo "The following binary packages could be rebuilt bit-by-bit identical to the ones distributed from ftp.debian.org:"
+# FIXME: this is irrelevant. instead the status of packages in the buildinfo file should be computed
+# (not the once we just build...)
 BADDEBS=""
 for DEB in $(dcmd ls *.changes|egrep 'deb$' ) ; do
 	SHASUM=$(sha256sum $DEB | awk '{ print $1 }')



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/c37ad851a06da14bfe6cb144570dc278cb1aca55

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/c37ad851a06da14bfe6cb144570dc278cb1aca55
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200507/96784101/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list