Bläddra i källkod

save the universe by not printing messages about apport if a package
with this name is not installed (Closes: #619646)

David Kalnischkies 14 år sedan
förälder
incheckning
dd61e64da1
2 ändrade filer med 9 tillägg och 1 borttagningar
  1. 6 0
      apt-pkg/deb/dpkgpm.cc
  2. 3 1
      debian/changelog

+ 6 - 0
apt-pkg/deb/dpkgpm.cc

@@ -1446,6 +1446,12 @@ void pkgDPkgPM::Reset()
 /* */
 /* */
 void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) 
 void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) 
 {
 {
+   // If apport doesn't exist or isn't installed do nothing
+   // This e.g. prevents messages in 'universes' without apport
+   pkgCache::PkgIterator apportPkg = Cache.FindPkg("apport");
+   if (apportPkg.end() == true || apportPkg->CurrentVer == 0)
+      return;
+
    string pkgname, reportfile, srcpkgname, pkgver, arch;
    string pkgname, reportfile, srcpkgname, pkgver, arch;
    string::size_type pos;
    string::size_type pos;
    FILE *report;
    FILE *report;

+ 3 - 1
debian/changelog

@@ -5,6 +5,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
     - chroot if needed before dpkg --assert-multi-arch
     - chroot if needed before dpkg --assert-multi-arch
     - ensure that dpkg binary doesn't have the chroot-directory prefixed
     - ensure that dpkg binary doesn't have the chroot-directory prefixed
     - call dpkg --assert-multi-arch with execvp instead of execv
     - call dpkg --assert-multi-arch with execvp instead of execv
+    - save the universe by not printing messages about apport if a package
+      with this name is not installed (Closes: #619646)
   * apt-pkg/depcache.cc:
   * apt-pkg/depcache.cc:
     - if a M-A:same package is marked for reinstall, mark all it's installed
     - if a M-A:same package is marked for reinstall, mark all it's installed
       silbings for reinstallation as well (LP: #859188)
       silbings for reinstallation as well (LP: #859188)
@@ -42,7 +44,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
   * apt-pkg/contrib/fileutl.h:
   * apt-pkg/contrib/fileutl.h:
     - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode
     - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode
 
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 11 Feb 2012 18:54:11 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 11 Feb 2012 20:59:13 +0100
 
 
 apt (0.8.16~exp12) experimental; urgency=low
 apt (0.8.16~exp12) experimental; urgency=low