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

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



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


Commits:
df02db89 by Holger Levsen at 2022-08-29T21:25:24+02:00
reproducible Debian: refactoring

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

- - - - -
835bdc62 by Holger Levsen at 2022-08-29T21:28:15+02:00
reproducible Debian: work around some more unreproducible logfiles kept only by cdebootstrap

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

- - - - -


1 changed file:

- bin/reproducible_debstrap.sh


Changes:

=====================================
bin/reproducible_debstrap.sh
=====================================
@@ -27,6 +27,16 @@ cleanup() {
 	fi
 }
 
+cleanup_unreproducible_file(){
+	TYPE=$1
+	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
+	else
+		output_echo "Warning: shall remove $FILE but it does not exist. Maybe $TOOL was improved."
+	fi
+}
 
 # Init some variables
 export TOOL="$1"
@@ -66,21 +76,16 @@ for LOOP in "first" "second" ; do
 				;;
 		debootstrap|cdebootstrap)
 				sudo $REALTOOL $SUITE $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}
-				for LOGFILE in /var/log/bootstrap.log /var/log/dpkg.log /var/log/alternatives.log ; do
-					if [ -f $LOGFILE ] ; then
-						output_echo "Warning: modifying $TOOL result, deleting unreproducible logfile $LOGFILE"
-						sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$LOGFILE
-					else
-						output_echo "Warning: shall remove $LOGFILE but it does not exist. Maybe $TOOL was improved."
-					fi
+				# 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
+					cleanup_unreproducible_file "unreproducible logfile" $FILE
 				done
 				for FILE in /etc/machine-id /var/cache/ldconfig/aux-cache ; do
-					if [ -f $LOGFILE ] ; then
-						output_echo "Warning: modifying $TOOL result, deleting unreproducible file $FILE because it will be created as needed"
-						sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$FILE
-					else
-						output_echo "Warning: shall remove $FILE but it does not exist. Maybe $TOOL was improved."
-					fi
+					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/-/compare/f71341bb9eda6f45e385ed5075239327051e36df...835bdc624ec603703a5b02b4166aeb1310b3c943

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/f71341bb9eda6f45e385ed5075239327051e36df...835bdc624ec603703a5b02b4166aeb1310b3c943
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/faf76f43/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list