diff options
author | Guillem Jover <guillem@debian.org> | 2012-04-27 05:30:00 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2012-04-27 10:04:24 +0200 |
commit | f45abe4758e705b6c3231ba9a34ac066530b27e4 (patch) | |
tree | ec0c9ea214eaac66d5b71a7170b37cf543daf39d | |
parent | 63d60245748acb6095e8e28ae2d86bfffd2e9fad (diff) | |
download | dpkg-f45abe4758e705b6c3231ba9a34ac066530b27e4.tar.gz |
dpkg: Add missing list and md5sums database file checks to --audit
This will report about any package missing the list or md5sums files
from the database, so that they can be reinstalled.
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | src/enquiry.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index d3f362621..5b7127c9b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -42,6 +42,7 @@ dpkg (1.16.3) UNRELEASED; urgency=low package instances. * Generate md5sums files automatically at unpack time if missing from the binary package. Closes: #155676, #155799 + * Add missing list and md5sums database file checks to «dpkg --audit». [ Helge Kreutzmann ] * Fix a typo in man/dpkg-buildflags.1. diff --git a/src/enquiry.c b/src/enquiry.c index 1dfa6c41c..e039529a0 100644 --- a/src/enquiry.c +++ b/src/enquiry.c @@ -47,6 +47,7 @@ #include <dpkg/options.h> #include "filesdb.h" +#include "infodb.h" #include "main.h" struct badstatinfo { @@ -73,6 +74,14 @@ bsyn_status(struct pkginfo *pkg, const struct badstatinfo *bsi) } static bool +bsyn_infofile(struct pkginfo *pkg, const struct badstatinfo *bsi) +{ + if (pkg->status < stat_halfinstalled) + return false; + return !pkg_infodb_has_file(pkg, &pkg->installed, bsi->value.string); +} + +static bool bsyn_arch(struct pkginfo *pkg, const struct badstatinfo *bsi) { if (pkg->status < stat_halfinstalled) @@ -124,6 +133,18 @@ static const struct badstatinfo badstatinfos[]= { "has not yet been done. Trigger processing can be requested using\n" "dselect or dpkg --configure --pending (or dpkg --triggers-only):\n") }, { + .yesno = bsyn_infofile, + .value.string = LISTFILE, + .explanation = N_( + "The following packages are missing the list control file in the\n" + "database, they need to be reinstalled:\n") + }, { + .yesno = bsyn_infofile, + .value.string = HASHFILE, + .explanation = N_( + "The following packages are missing the md5sums control file in the\n" + "database, they need to be reinstalled:\n") + }, { .yesno = bsyn_arch, .value.number = arch_none, .explanation = N_("The following packages do not have an architecture:\n") |