]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire-item.cc
always cleanup patchfiles at the end of rred call
[apt.git] / apt-pkg / acquire-item.cc
index 7f64435555f36811074ec1ccf27f2b4b097bb0eb..60003c02313d6f4d1d7cbc6a93b5faf0cc109c7c 100644 (file)
@@ -513,14 +513,9 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)         /*{{{*/
         bool pdiff_merge = _config->FindB("Acquire::PDiffs::Merge", true);
         if (pdiff_merge == true)
         {
-           // this perl script is provided by apt-file
-           pdiff_merge = FileExists(_config->FindFile("Dir::Bin::rred", "/usr/bin/diffindex-rred"));
-           if (pdiff_merge == true)
-           {
-              // reprepro adds this flag if it has merged patches on the server
-              std::string const precedence = Tags.FindS("X-Patch-Precedence");
-              pdiff_merge = (precedence != "merged");
-           }
+           // reprepro adds this flag if it has merged patches on the server
+           std::string const precedence = Tags.FindS("X-Patch-Precedence");
+           pdiff_merge = (precedence != "merged");
         }
 
         if (pdiff_merge == false)
@@ -762,6 +757,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size,string Md5Has
    {
       // remove the just applied patch
       available_patches.erase(available_patches.begin());
+      unlink((FinalFile + ".ed").c_str());
 
       // move into place
       if(Debug) 
@@ -892,6 +888,14 @@ void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,string M
       // otherwise lists cleanup will eat the file
       DestFile = FinalFile;
 
+      // ensure the ed's are gone regardless of list-cleanup
+      for (std::vector<pkgAcqIndexMergeDiffs *>::const_iterator I = allPatches->begin();
+           I != allPatches->end(); ++I)
+      {
+           std::string patch = FinalFile + ".ed." + (*I)->patch.file + ".gz";
+           unlink(patch.c_str());
+      }
+
       // all set and done
       Complete = true;
       if(Debug)