summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 0cded32e1..3f6039e0d 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1684,7 +1684,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
if (apportPkg.end() == true || apportPkg->CurrentVer == 0)
return;
- string pkgname, reportfile, srcpkgname, pkgver, arch;
+ string pkgname, reportfile, pkgver, arch;
string::size_type pos;
FILE *report;
@@ -1823,7 +1823,16 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
time_t now = time(NULL);
fprintf(report, "Date: %s" , ctime(&now));
fprintf(report, "Package: %s %s\n", pkgname.c_str(), pkgver.c_str());
+#if APT_PKG_ABI >= 413
fprintf(report, "SourcePackage: %s\n", Ver.SourcePkgName());
+#else
+ pkgRecords Recs(Cache);
+ pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList());
+ std::string srcpkgname = Parse.SourcePkg();
+ if(srcpkgname.empty())
+ srcpkgname = pkgname;
+ fprintf(report, "SourcePackage: %s\n", srcpkgname.c_str());
+#endif
fprintf(report, "ErrorMessage:\n %s\n", errormsg);
// ensure that the log is flushed