[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible Arch Linux: record version being built and include prefer this when later determining version

Holger Levsen holger at layer-acht.org
Thu Nov 30 21:02:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit ee0eaca9c992da1c8142ecf8d25b93363c60fb62
Author: Holger Levsen <holger at layer-acht.org>
Date:   Thu Nov 30 21:01:39 2017 +0000

    reproducible Arch Linux: record version being built and include prefer this when later determining version
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_build_archlinux_pkg.sh |  7 ++++++-
 bin/reproducible_html_archlinux.sh      | 10 +++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/bin/reproducible_build_archlinux_pkg.sh b/bin/reproducible_build_archlinux_pkg.sh
index c6fdb16..385be03 100755
--- a/bin/reproducible_build_archlinux_pkg.sh
+++ b/bin/reproducible_build_archlinux_pkg.sh
@@ -166,6 +166,7 @@ first_build() {
 		epoch="$epoch:"
 	fi
 	VERSION="$epoch$pkgver-$pkgrel"
+	echo $VERSION > $TMPDIR/b1/$SRCPACKAGE/build1.version
 	# nicely run makepkg with a timeout of $TIMEOUT hours
 	timeout -k $TIMEOUT.1h ${TIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \
 		schroot --run-session -c $SESSION --directory "$BUILDDIR/$ACTUAL_SRCPACKAGE/trunk" -- bash -l -c "$MAKEPKG_ENV_VARS makepkg --syncdeps --noconfirm 2>&1" | tee -a $LOG
@@ -253,6 +254,7 @@ second_build() {
 		epoch="$epoch:"
 	fi
 	VERSION="$epoch$pkgver-$pkgrel"
+	echo $VERSION > $TMPDIR/b2/$SRCPACKAGE/build2.version
 	# nicely run makepkg with a timeout of $TIMEOUT hours
 	timeout -k $TIMEOUT.1h ${TIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \
 		schroot --run-session -c $SESSION --directory "$BUILDDIR/$ACTUAL_SRCPACKAGE/trunk" -- bash -l -c "$MAKEPKG_ENV_VARS makepkg --syncdeps --noconfirm 2>&1" | tee -a $LOG
@@ -368,7 +370,8 @@ elif [ "$1" = "1" ] || [ "$1" = "2" ] ; then
 	if ! mv -v /tmp/$SRCPACKAGE-$(basename $TMPDIR)/*/trunk/*.pkg.tar.xz $TMPDIR/b$MODE/$SRCPACKAGE/; then
 		echo "$(date -u) - build #$MODE for $SRCPACKAGE on $HOSTNAME didn't build a package!"
 		mkdir -p $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/
-		cp $TMPDIR/b$MODE/$SRCPACKAGE/build$MODE.log $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/
+		# copy build$MODE.(log|version) though this is probably useless - FIXME: confirm or disprove
+		cp $TMPDIR/b$MODE/$SRCPACKAGE/build$MODE.* $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/
 	fi
 
 	rm -r /tmp/$SRCPACKAGE-$(basename $TMPDIR)/
@@ -444,6 +447,8 @@ cd $TMPDIR/b1/$SRCPACKAGE
 cp build1.log $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/
 [ ! -f $TMPDIR/b2/$SRCPACKAGE/build2.log ] || cp $TMPDIR/b2/$SRCPACKAGE/build2.log $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/
 echo $DURATION > $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/pkg.build_duration || true
+cp build1.version $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/ || true
+[ ! -f $TMPDIR/b2/$SRCPACKAGE/build2.version ] || cp $TMPDIR/b2/$SRCPACKAGE/build2.version $BASE/archlinux/$REPOSITORY/$SRCPACKAGE/
 echo "$(date -u) - $REPRODUCIBLE_URL/archlinux/$REPOSITORY/$SRCPACKAGE/ updated."
 
 cd
diff --git a/bin/reproducible_html_archlinux.sh b/bin/reproducible_html_archlinux.sh
index 58db08e..53791db 100755
--- a/bin/reproducible_html_archlinux.sh
+++ b/bin/reproducible_html_archlinux.sh
@@ -56,7 +56,15 @@ for REPOSITORY in $ARCHLINUX_REPOS ; do
 			echo "     <tr>" >> $HTML_BUFFER
 			echo "      <td>$REPOSITORY</td>" >> $HTML_BUFFER
 			echo "      <td>$PKG</td>" >> $HTML_BUFFER
-			if [ $(ls $ARCHLINUX_PKG_PATH/*.pkg.tar.xz.html 2>/dev/null | wc -l) -eq 1 ] ; then
+			if [ -f $ARCHLINUX_PKG_PATH/build1.version ] ; then
+				VERSION=$($ARCHLINUX_PKG_PATH/build1.version)
+				if [ -f $ARCHLINUX_PKG_PATH/build2.log ] ; then
+					if ! diff -q $ARCHLINUX_PKG_PATH/build1.version $ARCHLINUX_PKG_PATH/build2.version ; then
+						irc_message archlinux-reproducible "$ARCHLINUX_PKG_PATH/build1.version and $ARCHLINUX_PKG_PATH/build2.version differ, this should not happen. Please tell h01ger."
+						VERSION="$VERSION or $($ARCHLINUX_PKG_PATH/build2.version)"
+					fi
+				fi
+			elif [ $(ls $ARCHLINUX_PKG_PATH/*.pkg.tar.xz.html 2>/dev/null | wc -l) -eq 1 ] ; then
 			# only determine version if there is exactly one artifact...
 			# else it's too error prone and in future the version will
 			# be determined during build anyway...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list