summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-09-07 09:57:09 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-09-07 09:57:09 +0200
commit8deb53abcc5c22cdbd8b17e0db8b752c3d2783c8 (patch)
tree19d7c2f43424e2aa7bdebfeb160af9d65c251380
parent3d661e4aa122dedcf830062f34b1db18cb45fc59 (diff)
do not replace /dev/null when running in APT::CDROM::NoAct
mode (LP: #612666), thanks to Colin Watson
-rw-r--r--apt-pkg/indexcopy.cc7
-rw-r--r--debian/changelog2
2 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc
index 0abbf63de..3156778d4 100644
--- a/apt-pkg/indexcopy.cc
+++ b/apt-pkg/indexcopy.cc
@@ -132,9 +132,14 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
(*I).c_str() + CDROM.length(),GetFileName());
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 c81026041..3cdeb593f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ apt (0.8.2) unstable; urgency=low
* apt-pkg/indexcopy.cc:
- only use trusted.gpg.d directory if it exists
+ - do not replace /dev/null when running in APT::CDROM::NoAct
+ mode (LP: #612666), thanks to Colin Watson
-- Michael Vogt <michael.vogt@ubuntu.com> Fri, 03 Sep 2010 20:21:43 +0200