make_mirror.sh: instead of rm -r, remove temporary files explicitly to avoid desaster

This commit is contained in:
Johannes 'josch' Schauer 2018-12-30 17:16:57 +01:00
parent 4ffa7bb69b
commit 903b318ccc
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -176,7 +176,19 @@ END
exit 1 exit 1
fi fi
rm -r "$rootdir" # cleanup
APT_CONFIG="$rootdir/etc/apt/apt.conf" apt-get --option Dir::Etc::SourceList=/dev/null update
APT_CONFIG="$rootdir/etc/apt/apt.conf" apt-get clean
rm "$rootdir/var/cache/apt/archives/lock"
rm "$rootdir/var/lib/apt/lists/lock"
rm "$rootdir/var/lib/dpkg/status"
rm "$rootdir/var/lib/dpkg/lock-frontend"
rm "$rootdir/var/lib/dpkg/lock"
rm "$rootdir/etc/apt/apt.conf"
rm "$rootdir/etc/apt/sources.list"
rm "$rootdir/oldaptnames"
rm "$rootdir/newaptnames"
find "$rootdir" -depth -print0 | xargs -0 rmdir
done done
done done