]> git.saurik.com Git - apt.git/blobdiff - methods/mirror.cc
remove duplicated 'the' from guides doc-base abstract
[apt.git] / methods / mirror.cc
index 977eddcf55a236cde7f9a6f2b3fd99e77bc0c878..01eed09f0fe2999846a662341305cb52ea011a8b 100644 (file)
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/hashes.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/metaindex.h>
+#include <apt-pkg/strutl.h>
 
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include <algorithm>
-#include <fstream>
 #include <iostream>
-
-#include <stdarg.h>
+#include <fstream>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/utsname.h>
 #include <dirent.h>
 
@@ -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;
@@ -122,7 +123,7 @@ bool MirrorMethod::Clean(string Dir)
       }
       // nothing found, nuke it
       if (I == list.end())
-        unlink(Dir->d_name);
+        RemoveFile("mirror", Dir->d_name);
    }
 
    closedir(D);
@@ -132,7 +133,7 @@ bool MirrorMethod::Clean(string Dir)
 }
 
 
-bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
+bool MirrorMethod::DownloadMirrorFile(string /*mirror_uri_str*/)
 {
    // not that great to use pkgAcquire here, but we do not have
    // any other way right now