From 3d661e4aa122dedcf830062f34b1db18cb45fc59 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 3 Sep 2010 20:49:09 +0200 Subject: apt-pkg/indexcopy.cc: include trustedFile (if it exists) --- apt-pkg/indexcopy.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'apt-pkg/indexcopy.cc') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index fb33ed461..0abbf63de 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -675,11 +675,9 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, std::vector keyrings; if (DirectoryExists(trustedPath)) - { - keyrings = GetListOfFilesInDir(trustedPath, "gpg", false, true); - if (FileExists(trustedFile) == true) - keyrings.push_back(trustedFile); - } + keyrings = GetListOfFilesInDir(trustedPath, "gpg", false, true); + if (FileExists(trustedFile) == true) + keyrings.push_back(trustedFile); std::vector Args; Args.reserve(30); -- cgit v1.2.3 From 8deb53abcc5c22cdbd8b17e0db8b752c3d2783c8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Sep 2010 09:57:09 +0200 Subject: do not replace /dev/null when running in APT::CDROM::NoAct mode (LP: #612666), thanks to Colin Watson --- apt-pkg/indexcopy.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apt-pkg/indexcopy.cc') 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 &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; -- cgit v1.2.3