[PATCH 5/6] EDSP: add Source field to Package stanzas
---
apt-pkg/edsp.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 93e8176..70b3654 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -16,6 +16,7 @@
#include <apt-pkg/tagfile.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/progress.h>
+#include <apt-pkg/pkgrecords.h>
#include <limits>
#include <stdio.h>
@@ -78,7 +79,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)
--
1.8.4.rc3
Reply to: