summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Eigensatz <patrickeigensatz@gmail.com>2016-10-07 21:45:07 +0200
committerAllan McRae <allan@archlinux.org>2016-12-05 06:20:08 +0100
commit46324d9b26bd4bf5624dd8743bcd2b8f9dc5616d (patch)
treeb62d71fa70d571252cd5cc24133fa5e24509d7f8 /src
parente83e868a77865d42a33076605f9a90a165f7c93a (diff)
downloadpacman-46324d9b26bd4bf5624dd8743bcd2b8f9dc5616d.tar.gz
pacman-46324d9b26bd4bf5624dd8743bcd2b8f9dc5616d.tar.xz
Give a "success!" message on database check
'pacman -Dk' prints a "success!" message if there were no errors. It is possible to suppress the output using the '-q / --quiet' flag. This implements the feature discussed at https://bugs.archlinux.org/task/50087 Signed-off-by: Patrick Eigensatz <patrick.eigensatz@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/database.c4
-rw-r--r--src/pacman/pacman.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/pacman/database.c b/src/pacman/database.c
index 01979034..3990ea2e 100644
--- a/src/pacman/database.c
+++ b/src/pacman/database.c
@@ -286,6 +286,10 @@ int pacman_database(alpm_list_t *targets)
} else {
ret = check_db_sync();
}
+
+ if(ret == 0 && !config->quiet) {
+ printf(_("No database errors have been found!\n"));
+ }
}
if(config->flags & (ALPM_TRANS_FLAG_ALLDEPS | ALPM_TRANS_FLAG_ALLEXPLICIT)) {
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index be52d1be..299a181a 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -171,6 +171,7 @@ static void usage(int op, const char * const myname)
addlist(_(" --asdeps mark packages as non-explicitly installed\n"));
addlist(_(" --asexplicit mark packages as explicitly installed\n"));
addlist(_(" -k, --check test local database for validity (-kk for sync databases)\n"));
+ addlist(_(" -q, --quiet suppress output of success messages\n"));
} else if(op == PM_OP_DEPTEST) {
printf("%s: %s {-T --deptest} [%s] [%s]\n", str_usg, myname, str_opt, str_pkg);
printf("%s:\n", str_opt);
@@ -466,6 +467,10 @@ static int parsearg_database(int opt)
case 'k':
(config->op_q_check)++;
break;
+ case OP_QUIET:
+ case 'q':
+ config->quiet = 1;
+ break;
default:
return 1;
}