[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible freebsd: carefully craft our own tar.xz archives...

Holger Levsen holger at moszumanska.debian.org
Tue Aug 25 23:34:14 UTC 2015


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 f8c753e72a133f35bd2cdd33a37f24fb877f105b
Author: Holger Levsen <holger at layer-acht.org>
Date:   Wed Aug 26 01:32:10 2015 +0200

    reproducible freebsd: carefully craft our own tar.xz archives...
---
 bin/reproducible_freebsd.sh                 | 11 +++++++----
 hosts/freebsd-jenkins/usr/local/etc/sudoers |  7 ++++++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/bin/reproducible_freebsd.sh b/bin/reproducible_freebsd.sh
index e2d13d2..816df07 100755
--- a/bin/reproducible_freebsd.sh
+++ b/bin/reproducible_freebsd.sh
@@ -27,9 +27,11 @@ save_freebsd_results(){
 	local RUN=$1
 	mkdir -p $TMPDIR/$RUN/
 	# copy results over
-	$RSCP:$TMPDIR $TMPDIR/$RUN
-	$RSSH "rm -r $TMPDIR ; mkdir $TMPDIR" 
-	find $TMPDIR/$RUN/ -name MD5 -o -name SHA512 -exec rm {} \;
+	DUMMY_DATE="$(date -u +'%Y-%m-%d') 00:00Z"
+	$RSSH "sudo find $TMPDIR --exec touch --date='$DUMMY_DATE'"
+	$RSSH "sudo find $TMPDIR -print0 | LC_ALL=C sort -z | sudo tar --null -T - --no-recursion -cJf $TMPDIR.tar.xz"
+	$RSCP:$TMPDIR.tar.xz $TMPDIR/$RUN
+	$RSSH "sudo rm -r $TMPDIR $TMPDIR.tar.xz ; mkdir $TMPDIR"
 }
 
 #
@@ -71,6 +73,7 @@ $RSSH "cd $TMPBUILDDIR ; TZ=$TZ sudo make -j $NUM_CPU buildkernel"
 $RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NUM_CPU installworld"
 $RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NUM_CPU installkernel"
 $RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NUM_CPU distribution"
+
 # save results in b1
 save_freebsd_results b1
 
@@ -97,9 +100,9 @@ $RSSH "cd $TMPBUILDDIR ; TZ=$TZ sudo make -j $NEW_NUM_CPU buildkernel"
 $RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NEW_NUM_CPU installworld"
 $RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NEW_NUM_CPU installkernel"
 $RSSH "cd $TMPBUILDDIR ; TZ=$TZ DESTDIR=$TMPDIR sudo make -j $NEW_NUM_CPU distribution"
+
 # save results in b2
 save_freebsd_results b2
-# cleanup... 
 
 # reset environment to default values again
 export LANG="en_GB.UTF-8"
diff --git a/hosts/freebsd-jenkins/usr/local/etc/sudoers b/hosts/freebsd-jenkins/usr/local/etc/sudoers
index 9a139c6..e8bcd2b 100644
--- a/hosts/freebsd-jenkins/usr/local/etc/sudoers
+++ b/hosts/freebsd-jenkins/usr/local/etc/sudoers
@@ -99,9 +99,14 @@ jenkins ALL= NOPASSWD: /usr/bin/make -j ? buildworld, \
 	/usr/bin/make -j ? distribution, \
 	/bin/rm -r /usr/src /usr/obj, \
 	/bin/rm -r /usr/obj, \
+	/bin/rm -r /srv/reproducible-results/* /srv/reproducible-results/*.tar.xz, \
 	/bin/mkdir /usr/obj, \
 	/bin/mkdir /usr/src /usr/obj, \
-	/usr/sbin/chown jenkins /usr/src /usr/obj
+	/usr/sbin/chown jenkins /usr/src /usr/obj, \
+	/usr/bin/find /srv/reproducible-results/* -exec touch *, \
+	/usr/bin/find /srv/reproducible-results/* -print0, \
+	/usr/bin/tar --null -T - --no-recursion -cJf *.tar.xz
+
 
 ## Uncomment to allow any user to run sudo if they know the password
 ## of the user they are running the command as (root by default).

-- 
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