diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-07 09:57:09 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-07 09:57:09 +0200 |
commit | 8deb53abcc5c22cdbd8b17e0db8b752c3d2783c8 (patch) | |
tree | 19d7c2f43424e2aa7bdebfeb160af9d65c251380 /apt-pkg/indexcopy.cc | |
parent | 3d661e4aa122dedcf830062f34b1db18cb45fc59 (diff) | |
download | apt-8deb53abcc5c22cdbd8b17e0db8b752c3d2783c8.tar.gz |
do not replace /dev/null when running in APT::CDROM::NoAct
mode (LP: #612666), thanks to Colin Watson
Diffstat (limited to 'apt-pkg/indexcopy.cc')
-rw-r--r-- | apt-pkg/indexcopy.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 0abbf63d..3156778d 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; |