do not clean up /run/lock as /var/lock is a symlink to it according to Debian policy §9.1.4

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-09-06 16:58:20 +02:00
parent 6416ce96c9
commit 7123808b6c
Signed by: josch
GPG key ID: F2CBA5C78FBD83E1
3 changed files with 7 additions and 4 deletions

View file

@ -3022,6 +3022,9 @@ sub run_cleanup() {
# skip the "." and ".." entries
next if $entry eq ".";
next if $entry eq "..";
# skip deleting /run/lock as /var/lock is a symlink to it
# according to Debian policy §9.1.4
next if $entry eq "lock";
debug "deleting files in /run: $entry";
0 == system(
'rm', '--interactive=never',

View file

@ -34,8 +34,8 @@ rm /tmp/debian-debootstrap/var/log/dpkg.log \
/tmp/debian-debootstrap/var/log/alternatives.log \
/tmp/debian-mm/var/log/bootstrap.log
# clear out /run
rm -r /tmp/debian-debootstrap/run/*
# clear out /run except for /run/lock
find /tmp/debian-debootstrap/run/ -mindepth 1 -maxdepth 1 ! -name lock -print0 | xargs --no-run-if-empty -0 rm -r
# debootstrap doesn't clean apt
rm /tmp/debian-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_unstable_main_binary-{{ HOSTARCH }}_Packages \

View file

@ -95,8 +95,8 @@ fi
if [ -e /tmp/debian-{{ DIST }}-mm/etc/apt/apt.conf.d/01autoremove-kernels ]; then
rm /tmp/debian-{{ DIST }}-mm/etc/apt/apt.conf.d/01autoremove-kernels
fi
# clear out /run
rm -r /tmp/debian-{{ DIST }}-debootstrap/run/*
# clear out /run except for /run/lock
find /tmp/debian-{{ DIST }}-debootstrap/run/ -mindepth 1 -maxdepth 1 ! -name lock -print0 | xargs --no-run-if-empty -0 rm -r
# debootstrap doesn't clean apt
rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_{{ DIST }}_main_binary-{{ HOSTARCH }}_Packages \
/tmp/debian-{{ DIST }}-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_{{ DIST }}_Release \