From 903b318ccc9a35b19ddaa00f319032c7a5c1fd7b Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sun, 30 Dec 2018 17:16:57 +0100 Subject: [PATCH] make_mirror.sh: instead of rm -r, remove temporary files explicitly to avoid desaster --- make_mirror.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/make_mirror.sh b/make_mirror.sh index 92bcc93..f6ecd90 100755 --- a/make_mirror.sh +++ b/make_mirror.sh @@ -176,7 +176,19 @@ END exit 1 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