[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian: refactoring

Holger Levsen (@holger) gitlab at salsa.debian.org
Mon Aug 29 20:41:49 BST 2022



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


Commits:
661879f8 by Holger Levsen at 2022-08-29T21:41:40+02:00
reproducible Debian: refactoring

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

- - - - -


1 changed file:

- bin/reproducible_debstrap.sh


Changes:

=====================================
bin/reproducible_debstrap.sh
=====================================
@@ -28,8 +28,8 @@ cleanup() {
 }
 
 cleanup_unreproducible_file(){
-	TYPE=$1
-	FILE=$2
+	local TYPE=$1
+	local FILE=$2
 	if [ -f $FILE ] ; then
 		output_echo "Warning: modifying $TOOL result, deleting $TYPE $FILE"
 		sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$FILE
@@ -76,17 +76,21 @@ for LOOP in "first" "second" ; do
 				;;
 		debootstrap|cdebootstrap)
 				sudo $REALTOOL $SUITE $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}
-				# work around logfiles and files kept by both debootstrap and cdebootstrap
-				for FILE in /var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log ; do
+				# work around unreproducible artifacts
+				case ${TOOL} in
+					debootstrap)	BAD_LOGFILES="/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log"
+							BAD_FILES="/etc/machine-id /var/cache/ldconfig/aux-cache"
+							;;
+					cdebootstrap)	BAD_LOGFILES="/var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log /var/log/apt/history.log /var/log/apt/term.log"
+							BAD_FILES="/etc/machine-id"
+							;;
+				esac
+				for FILE in $BAD_LOGFILES ; do
 					cleanup_unreproducible_file "unreproducible logfile" $FILE
 				done
-				for FILE in /etc/machine-id /var/cache/ldconfig/aux-cache ; do
+				for FILE in $BAD_FILES ; do
 					cleanup_unreproducible_file "unreproducible file" $FILE
 				done
-				# work around some more logfiles kept only by cdebootstrap
-				for FILE in /var/log/apt/history.log /var/log/apt/term.log /var/log/bootstrap.log ; do
-					cleanup_unreproducible_file "unreproducible logfile" $FILE
-				done
 				sudo tar --mtime="@$SOURCE_DATE_EPOCH" --clamp-mtime -C $BUILDDIR/$SUBDIR/${TOOL}/ -cf $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}.tar ${SUITE}
 				sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}
 				;;



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/661879f8450cca38d0ddbb7bebd894792f503e2d
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/20220829/42231406/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list