summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp.cc
diff options
context:
space:
mode:
authorStefano Zacchiroli <zack@debian.org>2013-09-05 10:54:12 +0200
committerStefano Zacchiroli <zack@debian.org>2014-05-04 18:27:10 +0200
commitb5ea5d4a5b8f82afb7bbe4c3eee07ae36f2fba9c (patch)
tree520ab22952e0970b7f5a334191cc928ddabebdee /apt-pkg/edsp.cc
parentf63c067e686b59ce9fa7c52bb39b7440e0770671 (diff)
EDSP: add APT-Release field to Package stanzas
Diffstat (limited to 'apt-pkg/edsp.cc')
-rw-r--r--apt-pkg/edsp.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 178791dae..88ad27681 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -113,10 +113,22 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI
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();
- for (pkgCache::VerFileIterator File = Ver.FileList(); File.end() == false; ++File) {
- signed short const p = Cache.GetPolicy().GetPriority(File.File());
+ 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->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource) {
+ string Release = File.RelStr();
+ if (!Release.empty())
+ Releases.insert(Release);
+ }
+ }
+ if (!Releases.empty()) {
+ fprintf(output, "APT-Release:\n");
+ 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);
if (Cache.GetCandidateVer(Pkg) == Ver)