]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.cc
reimplement build-dep via apts normal resolver
[apt.git] / apt-pkg / acquire-item.cc
index b73c4985f0d4dd3ad446a3e9e4fe8840a5ec29a8..446551cc2ee1a7c8bf38fa7d00599f27c91b2e60 100644 (file)
@@ -2103,22 +2103,35 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string const &IndexDiffFile)       /*{{{*/
 
    // clean the plate
    {
+      std::string const Final = GetExistingFilename(CurrentPackagesFile);
+      if (unlikely(Final.empty())) // because we wouldn't be called in such a case
+        return false;
       std::string const PartialFile = GetPartialFileNameFromURI(Target.URI);
-      std::vector<std::string> exts = APT::Configuration::getCompressorExtensions();
-      for (auto const &ext : exts)
+      if (FileExists(PartialFile) && RemoveFile("Bootstrap-linking", PartialFile) == false)
+      {
+        if (Debug)
+           std::clog << "Bootstrap-linking for patching " << CurrentPackagesFile
+              << " by removing stale " << PartialFile << " failed!" << std::endl;
+        return false;
+      }
+      for (auto const &ext : APT::Configuration::getCompressorExtensions())
       {
         std::string const Partial = PartialFile + ext;
-        if (FileExists(Partial))
-           RemoveFile("PDiffs-Bootstrap", Partial);
+        if (FileExists(Partial) && RemoveFile("Bootstrap-linking", Partial) == false)
+        {
+           if (Debug)
+              std::clog << "Bootstrap-linking for patching " << CurrentPackagesFile
+                 << " by removing stale " << Partial << " failed!" << std::endl;
+           return false;
+        }
       }
-      std::string const Final = GetExistingFilename(CurrentPackagesFile);
-      if (unlikely(Final.empty())) // because we wouldn't be called in such a case
-        return false;
       std::string const Ext = Final.substr(CurrentPackagesFile.length());
       std::string const Partial = PartialFile + Ext;
       if (symlink(Final.c_str(), Partial.c_str()) != 0)
       {
-        std::clog << "Bootstrap-linking for patching " << CurrentPackagesFile << " by linking " << Final << " to " << Partial << " failed!" << std::endl;
+        if (Debug)
+           std::clog << "Bootstrap-linking for patching " << CurrentPackagesFile
+              << " by linking " << Final << " to " << Partial << " failed!" << std::endl;
         return false;
       }
    }