* apt-pkg/indexcopy.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 5 Aug 2012 10:36:46 +0000 (12:36 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 5 Aug 2012 10:36:46 +0000 (12:36 +0200)
  - do not use atomic writing if the target is /dev/null as we don't want
    to replace it, not even automically. (Closes: #683410)

apt-pkg/indexcopy.cc
debian/changelog

index e29e281..c974453 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;
index 4646762..7092d81 100644 (file)
@@ -26,6 +26,9 @@ apt (0.9.7.4) UNRELEASED; urgency=low
   * doc/apt-verbatim.ent:
     - denote 'wheezy' as stable codename and 'jessie' as testing codename
       in the documentation in preparation for release
+  * apt-pkg/indexcopy.cc:
+    - do not use atomic writing if the target is /dev/null as we don't want
+      to replace it, not even automically. (Closes: #683410)
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 18 Jul 2012 11:45:57 +0200