]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/indexcopy.cc
* apt-pkg/cdrom.cc:
[apt.git] / apt-pkg / indexcopy.cc
index e29e2819cb5eb5a806da8a757624999cc2534a06..c97445326011c9e1b56d1d162f81a49b3492df61 100644 (file)
@@ -810,9 +810,14 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,  /*{{{*/
               (*I).c_str() + CDROM.length());
       string TargetF = _config->FindDir("Dir::State::lists") + "partial/";
       TargetF += URItoFileName(S);
+      FileFd Target;
       if (_config->FindB("APT::CDROM::NoAct",false) == true)
+      {
         TargetF = "/dev/null";
-      FileFd Target(TargetF,FileFd::WriteAtomic);
+        Target.Open(TargetF,FileFd::WriteExists);
+      } else {
+        Target.Open(TargetF,FileFd::WriteAtomic);
+      }
       FILE *TargetFl = fdopen(dup(Target.Fd()),"w");
       if (_error->PendingError() == true)
         return false;