From 9bb4eb6aa2928253118eec72cc3b843778b043e9 Mon Sep 17 00:00:00 2001 From: Patrick Eigensatz Date: Sun, 25 Sep 2016 12:58:24 +0200 Subject: [PATCH] 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 --- src/pacman/database.c | 4 ++++ src/pacman/pacman.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/pacman/database.c b/src/pacman/database.c index 0197903..5143031 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(_("success!\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 be52d1b..b477df7 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -466,6 +466,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; } -- 2.10.0