Commit 3ffc6568 authored by Holger Levsen's avatar Holger Levsen
Browse files

reproducible Debian: refactoring



Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 661879f8
...@@ -30,10 +30,11 @@ cleanup() { ...@@ -30,10 +30,11 @@ cleanup() {
cleanup_unreproducible_file(){ cleanup_unreproducible_file(){
local TYPE=$1 local TYPE=$1
local FILE=$2 local FILE=$2
if [ -f $FILE ] ; then if sudo file -E $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$FILE >/dev/null 2>&1 ; then
output_echo "Warning: modifying $TOOL result, deleting $TYPE $FILE" output_echo "Warning: modifying $TOOL result, deleting unreproducible $TYPE $FILE"
sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$FILE sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$FILE
else else
sudo file $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}/$FILE
output_echo "Warning: shall remove $FILE but it does not exist. Maybe $TOOL was improved." output_echo "Warning: shall remove $FILE but it does not exist. Maybe $TOOL was improved."
fi fi
} }
...@@ -77,19 +78,18 @@ for LOOP in "first" "second" ; do ...@@ -77,19 +78,18 @@ for LOOP in "first" "second" ; do
debootstrap|cdebootstrap) debootstrap|cdebootstrap)
sudo $REALTOOL $SUITE $BUILDDIR/$SUBDIR/${TOOL}/${SUITE} sudo $REALTOOL $SUITE $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}
# work around unreproducible artifacts # 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" BAD_FILES="/etc/machine-id /var/cache/ldconfig/aux-cache"
case ${TOOL} in
debootstrap) BAD_LOGFILES="/var/log/dpkg.log /var/log/alternatives.log /var/log/bootstrap.log"
;; ;;
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" cdebootstrap) BAD_LOGFILES="/var/log/dpkg.log /var/log/alternatives.log /var/log/bootstrap.log /var/log/apt/history.log /var/log/apt/term.log"
BAD_FILES="/etc/machine-id"
;; ;;
esac esac
for FILE in $BAD_LOGFILES ; do for i in $BAD_LOGFILES ; do
cleanup_unreproducible_file "unreproducible logfile" $FILE cleanup_unreproducible_file logfile "$i"
done done
for FILE in $BAD_FILES ; do for i in $BAD_FILES ; do
cleanup_unreproducible_file "unreproducible file" $FILE cleanup_unreproducible_file file "$i"
done done
sudo tar --mtime="@$SOURCE_DATE_EPOCH" --clamp-mtime -C $BUILDDIR/$SUBDIR/${TOOL}/ -cf $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}.tar ${SUITE} 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} sudo rm -rf --one-file-system $BUILDDIR/$SUBDIR/${TOOL}/${SUITE}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment