diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-06 16:36:28 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-06 16:36:28 +0200 |
commit | 9bafec989612e0bb751e4ba1e3a81d21233ccb9b (patch) | |
tree | b2cce1888063d16766899cd906307c4842cc4a2e /apt-pkg/deb | |
parent | 6ac27e73bd00d18fedd9998efef17a98c10fc14a (diff) |
merged lp:~brian-murray/apt/history-log
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 30f3b7d0f..b9f49365d 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1322,6 +1322,13 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) return; } + // do not report bugs regarding inaccessible local files + if(strstr(errormsg, strerror(ENOENT)) != NULL || + strstr(errormsg, "Cannot access archive") != NULL) { + std::clog << _("No apport report written because the error message indicates an issue on the local system") << std::endl; + return; + } + // do not report dpkg I/O errors, this is a format string, so we compare // the prefix and the suffix of the error with the dpkg error message vector<string> io_errors; @@ -1439,6 +1446,23 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) } } + // attach history log it if we have it + string histfile_name = _config->FindFile("Dir::Log::History"); + if (!histfile_name.empty()) + { + FILE *log = NULL; + char buf[1024]; + + fprintf(report, "DpkgHistoryLog:\n"); + log = fopen(histfile_name.c_str(),"r"); + if(log != NULL) + { + while( fgets(buf, sizeof(buf), log) != NULL) + fprintf(report, " %s", buf); + fclose(log); + } + } + // log the ordering const char *ops_str[] = {"Install", "Configure","Remove","Purge"}; fprintf(report, "AptOrdering:\n"); |