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/edsp.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'apt-pkg/edsp.cc') diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 90f20472e..bf625cc97 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -84,7 +84,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg fprintf(output, " %s\n", R->c_str()); } fprintf(output, "APT-Pin: %d\n", Pin); - if (Cache.GetCandidateVer(Pkg) == Ver) + if (Cache.GetCandidateVersion(Pkg) == Ver) fprintf(output, "APT-Candidate: yes\n"); if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto) fprintf(output, "APT-Automatic: yes\n"); @@ -510,9 +510,10 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output) } else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true) { - fprintf(output, "Install: %d\n", Cache.GetCandidateVer(Pkg)->ID); + pkgCache::VerIterator const CandVer = Cache.GetCandidateVersion(Pkg); + fprintf(output, "Install: %d\n", CandVer->ID); if (Debug == true) - fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Cache.GetCandidateVer(Pkg).VerStr()); + fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), CandVer.VerStr()); } else if (Cache[Pkg].Garbage == true) { -- cgit v1.2.3