summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-04-25 13:26:08 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-04-25 15:35:52 +0200
commit3c7567a586690042fdd899c7e82543cb31a3b853 (patch)
tree7c471d5d788e3b86efbb550438e437d7bd7ce722
parent9b8034a9fd40b4d05075fda719e61f6eb4c45678 (diff)
edsp: ask policy engine for the pin of the version directly
-rw-r--r--apt-pkg/edsp.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 59e8e7ab4..610f9379e 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -65,13 +65,9 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg
fprintf(output, "Multi-Arch: foreign\n");
else if ((Ver->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
fprintf(output, "Multi-Arch: same\n");
- signed short Pin = std::numeric_limits<signed short>::min();
std::set<string> Releases;
for (pkgCache::VerFileIterator I = Ver.FileList(); I.end() == false; ++I) {
pkgCache::PkgFileIterator File = I.File();
- signed short const p = Cache.GetPolicy().GetPriority(File);
- if (Pin < p)
- Pin = p;
if (File.Flagged(pkgCache::Flag::NotSource) == false) {
string Release = File.RelStr();
if (!Release.empty())
@@ -83,7 +79,7 @@ static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::Pkg
for (std::set<string>::iterator R = Releases.begin(); R != Releases.end(); ++R)
fprintf(output, " %s\n", R->c_str());
}
- fprintf(output, "APT-Pin: %d\n", Pin);
+ fprintf(output, "APT-Pin: %d\n", Cache.GetPolicy().GetPriority(Ver));
if (Cache.GetCandidateVersion(Pkg) == Ver)
fprintf(output, "APT-Candidate: yes\n");
if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto)