From 4429616bd6b13499981da3d7d542f71e4f3ece8c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Aug 2010 12:27:39 +0200 Subject: apt-pkg/algorithms.cc: in the case of conflicts/breaks against a Provide Start.AllTarget() returns all non-canidates as well, we want to filter them out --- apt-pkg/algorithms.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 3c8711b74..a46dce2db 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -987,6 +987,23 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) pkgCache::VerIterator Ver(Cache,*V); pkgCache::PkgIterator Pkg = Ver.ParentPkg(); + /* Ignore a target that is not a candidate + This can happen if: + installed package provides video-6 + candidate provides video-8 + now if a package Start breaks/conflicts video-6 + Start.AllTargets() will return the now-installed + versions even though these are not candidates + we can ignore them + */ + if (Cache[Pkg].CandidateVerIter(Cache) != Ver) + { + clog << " Version " << Ver.VerStr() << " for " + << Pkg.Name() << " is not a candidate, ignoring" + << endl; + continue; + } + if (Debug == true) clog << " Considering " << Pkg.FullName(false) << ' ' << (int)Scores[Pkg->ID] << " as a solution to " << I.FullName(false) << ' ' << (int)Scores[I->ID] << endl; -- cgit v1.2.3 From 914cc8a4438fd4f8c060599fa1971b80236a016e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Aug 2010 13:27:59 +0200 Subject: apt-pkg/algorithms.cc: if a package was added to the kill list via a DpkgBreaks, make sure to break in the loop (just like for a conflict) --- apt-pkg/algorithms.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index a46dce2db..d9e0d2f81 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1097,7 +1097,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) if (Start->Type == pkgCache::Dep::DpkgBreaks) { - // first, try upgradring the package, if that + // first, try upgrading the package, if that // does not help, the breaks goes onto the // kill list // FIXME: use DoUpgrade(Pkg) instead? @@ -1122,6 +1122,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) LEnd++; if (Start->Type != pkgCache::Dep::Conflicts && + Start->Type != pkgCache::Dep::DpkgBreaks && Start->Type != pkgCache::Dep::Obsoletes) break; } -- cgit v1.2.3 From 24e936625600312682a34872a2425f3382f3df2f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Aug 2010 13:32:50 +0200 Subject: apt-pkg/algorithms.cc: show debug output only if debug option is given --- apt-pkg/algorithms.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index d9e0d2f81..bd9a9df62 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -998,9 +998,10 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) */ if (Cache[Pkg].CandidateVerIter(Cache) != Ver) { - clog << " Version " << Ver.VerStr() << " for " - << Pkg.Name() << " is not a candidate, ignoring" - << endl; + if (Debug) + clog << " Version " << Ver.VerStr() << " for " + << Pkg.Name() << " is not a candidate, ignoring" + << endl; continue; } -- cgit v1.2.3 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(-) 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 ++++++- debian/changelog | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) 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; 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 Fri, 03 Sep 2010 20:21:43 +0200 -- cgit v1.2.3