summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire.cc1
-rw-r--r--apt-pkg/clean.cc1
-rw-r--r--methods/mirror.cc1
-rw-r--r--test/integration/framework4
-rwxr-xr-xtest/integration/test-apt-get-clean7
5 files changed, 10 insertions, 4 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index fb1210750..e61f4192d 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -688,6 +688,7 @@ bool pkgAcquire::Clean(string Dir)
// Skip some files..
if (strcmp(Dir->d_name,"lock") == 0 ||
strcmp(Dir->d_name,"partial") == 0 ||
+ strcmp(Dir->d_name,"lost+found") == 0 ||
strcmp(Dir->d_name,".") == 0 ||
strcmp(Dir->d_name,"..") == 0)
continue;
diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc
index ebe8a8a53..8e6bd6255 100644
--- a/apt-pkg/clean.cc
+++ b/apt-pkg/clean.cc
@@ -54,6 +54,7 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache)
// Skip some files..
if (strcmp(Dir->d_name,"lock") == 0 ||
strcmp(Dir->d_name,"partial") == 0 ||
+ strcmp(Dir->d_name,"lost+found") == 0 ||
strcmp(Dir->d_name,".") == 0 ||
strcmp(Dir->d_name,"..") == 0)
continue;
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 56362d317..01eed09f0 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -106,6 +106,7 @@ bool MirrorMethod::Clean(string Dir)
// Skip some files..
if (strcmp(Dir->d_name,"lock") == 0 ||
strcmp(Dir->d_name,"partial") == 0 ||
+ strcmp(Dir->d_name,"lost+found") == 0 ||
strcmp(Dir->d_name,".") == 0 ||
strcmp(Dir->d_name,"..") == 0)
continue;
diff --git a/test/integration/framework b/test/integration/framework
index 7a56a9acd..de8a65d7a 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1766,8 +1766,8 @@ listcurrentlistsdirectory() {
### convenience hacks ###
mkdir() {
# creating some directories by hand is a tedious task, so make it look simple
- if [ "$*" = '-p rootdir/var/lib/apt/lists' ] || [ "$*" = "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists" ] ||
- [ "$*" = '-p rootdir/var/lib/apt/lists/partial' ] || [ "$*" = "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial" ]; then
+ local PARAMS="$*"
+ if [ "$PARAMS" != "${PARAMS#*rootdir/var/lib/apt/lists}" ]; then
# only the last directory created by mkdir is effected by the -m !
command mkdir -m 755 -p "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt"
command mkdir -m 755 -p "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists"
diff --git a/test/integration/test-apt-get-clean b/test/integration/test-apt-get-clean
index 31e9900c9..00f9d4e60 100755
--- a/test/integration/test-apt-get-clean
+++ b/test/integration/test-apt-get-clean
@@ -11,7 +11,10 @@ insertpackage 'testing' 'foo' 'all' '1'
insertpackage 'unstable' 'foo' 'all' '2'
insertinstalledpackage 'foo' 'all' '3'
-setupaptarchive
+setupaptarchive --no-update
+
+mkdir -p rootdir/var/lib/apt/lists/lost+found
+testsuccess apt update
# nothing to do always works
testsuccess aptget clean
@@ -19,7 +22,7 @@ testsuccess aptget clean -s
# generate some dirt and clean it up
touch rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en
-mkdir -p rootdir/var/cache/apt/archives
+mkdir -p rootdir/var/cache/apt/archives/lost+found
touch rootdir/var/cache/apt/archives/foo_1_all.deb
touch rootdir/var/cache/apt/archives/foo_2_all.deb
touch rootdir/var/cache/apt/archives/foo_3_all.deb