summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/depcache.cc32
-rw-r--r--apt-pkg/depcache.h2
-rw-r--r--debian/changelog3
3 files changed, 35 insertions, 2 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 3ae5f5953..d082b8404 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1453,6 +1453,9 @@ bool pkgDepCache::IsInstallOk(PkgIterator const &Pkg,bool AutoInst,
/* */
void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To)
{
+ if (unlikely(Pkg.end() == true))
+ return;
+
ActionGroup group(*this);
RemoveSizes(Pkg);
@@ -1466,12 +1469,17 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To)
AddStates(Pkg);
AddSizes(Pkg);
+
+ if (unlikely(Pkg.CurrentVer().end() == true) || Pkg.CurrentVer().Pseudo() == false)
+ return;
+
+ SetReInstall(Pkg.Group().FindPkg("all"), To);
}
/*}}}*/
// DepCache::SetCandidateVersion - Change the candidate version /*{{{*/
// ---------------------------------------------------------------------
/* */
-void pkgDepCache::SetCandidateVersion(VerIterator TargetVer)
+void pkgDepCache::SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo)
{
ActionGroup group(*this);
@@ -1489,6 +1497,28 @@ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer)
AddStates(Pkg);
Update(Pkg);
AddSizes(Pkg);
+
+ if (TargetVer.Pseudo() == false || Pseudo == false)
+ return;
+
+ // the version was pseudo: set all other pseudos also
+ pkgCache::GrpIterator Grp = Pkg.Group();
+ for (Pkg = Grp.FindPkg("any"); Pkg.end() == false; ++Pkg)
+ {
+ StateCache &P = PkgState[Pkg->ID];
+ if (TargetVer.SimilarVer(P.CandidateVerIter(*this)) == true ||
+ (P.CandidateVerIter(*this).Pseudo() == false &&
+ strcmp(Pkg.Arch(), "all") != 0))
+ continue;
+
+ for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
+ {
+ if (TargetVer.SimilarVer(Ver) == false)
+ continue;
+ SetCandidateVersion(Ver, false);
+ break;
+ }
+ }
}
void pkgDepCache::MarkAuto(const PkgIterator &Pkg, bool Auto)
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index c6f245a80..72d7cce5d 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -405,7 +405,7 @@ class pkgDepCache : protected pkgCache::Namespace
bool ForceImportantDeps = false);
void SetReInstall(PkgIterator const &Pkg,bool To);
- void SetCandidateVersion(VerIterator TargetVer);
+ void SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo = true);
/** Set the "is automatically installed" flag of Pkg. */
void MarkAuto(const PkgIterator &Pkg, bool Auto);
diff --git a/debian/changelog b/debian/changelog
index 2648730ec..4de21d343 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,9 @@ apt (0.7.26~exp8) UNRELEASED; urgency=low
- packages that are not touched doesn't need to be unpacked
* debian/control:
- remove intltool's dependency as it is an ubuntu artefact
+ * apt-pkg/depcache.cc:
+ - SetCandidateVer for all pseudo packages
+ - SetReInstall for the "all" package of a pseudo package
-- David Kalnischkies <kalnischkies@gmail.com> Thu, 10 Jun 2010 16:36:58 +0200