From 294a80209a0c6ea617a14fb2ae650d4fd329eab5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 30 Oct 2015 16:34:25 +0100 Subject: sanify API to get 'the' candidate version This was discussed a while ago on #debian-apt and now that I see myself making this mistake lets bite the bullet and fix it in the easy way out version: Using a new name which fits with a similar named setter and deprecate the old method instead of 'hostily' changing API. Closes: #803471 --- apt-pkg/depcache.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apt-pkg/depcache.cc') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 39bbe484f..a3d2f6449 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -153,7 +153,7 @@ bool pkgDepCache::Init(OpProgress * const Prog) State.iFlags = 0; // Figure out the install version - State.CandidateVer = GetCandidateVer(I); + State.CandidateVer = LocalPolicy->GetCandidateVer(I); State.InstallVer = I.CurrentVer(); State.Mode = ModeKeep; @@ -1467,6 +1467,11 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) } } /*}}}*/ +pkgCache::VerIterator pkgDepCache::GetCandidateVersion(PkgIterator const &Pkg)/*{{{*/ +{ + return PkgState[Pkg->ID].CandidateVerIter(*this); +} + /*}}}*/ // DepCache::SetCandidateVersion - Change the candidate version /*{{{*/ // --------------------------------------------------------------------- /* */ -- cgit v1.2.3