From d5da93b83f886b87958e52d4658b9f08b255b36c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 5 Aug 2012 12:36:46 +0200 Subject: * 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) --- apt-pkg/indexcopy.cc | 7 ++++++- debian/changelog | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index e29e2819c..c97445326 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -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; diff --git a/debian/changelog b/debian/changelog index 4646762f6..7092d8164 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 18 Jul 2012 11:45:57 +0200 -- cgit v1.2.3