summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-10-30 16:34:25 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-04 18:04:05 +0100
commit294a80209a0c6ea617a14fb2ae650d4fd329eab5 (patch)
tree6430408a0b5ceaae3bb862fb144c265adb116b46 /apt-pkg/edsp.cc
parent51818f26c784bb574dafc545e8ae320845e5e8fc (diff)
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
Diffstat (limited to 'apt-pkg/edsp.cc')
-rw-r--r--apt-pkg/edsp.cc7
1 files changed, 4 insertions, 3 deletions
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)
{