summaryrefslogtreecommitdiff
path: root/src/enquiry.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2010-07-02 13:13:01 +0200
committerGuillem Jover <guillem@debian.org>2010-07-03 07:46:12 +0200
commitc3d9eea8d03d93eed6e2d87a97acfca5562b2b32 (patch)
tree5267ece1e01b42fd57dd0962e1ab6fde6fb656b7 /src/enquiry.c
parent0238821c66112e5403dd8abbf6eca0962866d944 (diff)
downloaddpkg-c3d9eea8d03d93eed6e2d87a97acfca5562b2b32.tar.gz
dpkg: Detect locked databases on --audit
Detect when another process has locked the database, and mention that problematic dpkg --audit results might be due to ongoing operations. Closes: #80252
Diffstat (limited to 'src/enquiry.c')
-rw-r--r--src/enquiry.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/enquiry.c b/src/enquiry.c
index af4542695..d8e1a4fb8 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -124,6 +124,7 @@ static void describebriefly(struct pkginfo *pkg) {
void audit(const char *const *argv) {
const struct badstatinfo *bsi;
+ bool head_running = false;
if (*argv)
badusage(_("--%s takes no arguments"), cipaction->olong);
@@ -138,6 +139,13 @@ void audit(const char *const *argv) {
it= iterpkgstart();
while ((pkg= iterpkgnext(it))) {
if (!bsi->yesno(pkg,bsi)) continue;
+ if (!head_running) {
+ if (modstatdb_is_locked(admindir))
+ puts(_(
+"Another process has locked the database for writing, and might currently be\n"
+"modifying it, some of the following problems might just be due to that.\n"));
+ head_running = true;
+ }
if (!head) {
fputs(gettext(bsi->explanation),stdout);
head = true;