summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorStefano Zacchiroli <zack@debian.org>2013-09-05 16:36:44 +0200
committerStefano Zacchiroli <zack@debian.org>2014-05-04 18:27:10 +0200
commitf63c067e686b59ce9fa7c52bb39b7440e0770671 (patch)
tree28969f98914a4df0ea0e7b0fb3a6cbd5bf04ca02 /apt-pkg
parentcaa3279367401965cbdd5e3a41c47945f3e263bd (diff)
EDSP: add Source field to Package stanzas
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/edsp.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 33478dfa6..178791dae 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -18,6 +18,7 @@
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/pkgrecords.h>
#include <ctype.h>
#include <stddef.h>
@@ -87,7 +88,12 @@ bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg,
pkgCache::VerIterator const &Ver)
{
+ pkgRecords Recs(Cache);
+ pkgRecords::Parser &rec = Recs.Lookup(Ver.FileList());
+ string srcpkg = rec.SourcePkg().empty() ? Pkg.Name() : rec.SourcePkg();
+
fprintf(output, "Package: %s\n", Pkg.Name());
+ fprintf(output, "Source: %s\n", srcpkg.c_str());
fprintf(output, "Architecture: %s\n", Ver.Arch());
fprintf(output, "Version: %s\n", Ver.VerStr());
if (Pkg.CurrentVer() == Ver)