[pacman-dev] [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 <patrick.eigensatz@gmail.com> --- 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
On 09/25/16 at 02:02pm, Patrick Eigensatz wrote:
'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> --- 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"));
Let's make this a little more specific; something like "no errors found".
+ } }
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;
The man page and --help need to be updated to reflect this.
default: return 1; } -- 2.10.0
Hi Andrew! Thank you for your feedback! I'll change "success!" to "No errors were found" if this is okay. I will also try to change the output of --help and also adjust the man page. Ps: Is it possible to tell git send-email to reply to the message with this ID? Thanks again Patrick Andrew Gregory <andrew.gregory.8@gmail.com> schrieb am Mi., 28. Sep. 2016, 21:19:
On 09/25/16 at 02:02pm, Patrick Eigensatz wrote:
'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> --- 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"));
Let's make this a little more specific; something like "no errors found".
+ } }
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;
The man page and --help need to be updated to reflect this.
default: return 1; } -- 2.10.0
On 29/09/16 05:29, Patrick Eigensatz wrote:
Ps: Is it possible to tell git send-email to reply to the message with this ID?
--in-reply-to=<identifier> (although I am fairly sure no-one does that...)
Thanks, Allan! So I'll just resubmit my patch then? Could not find any intel about this... Patrick Allan McRae <allan@archlinux.org> schrieb am Do., 29. Sep. 2016, 06:25:
On 29/09/16 05:29, Patrick Eigensatz wrote:
Ps: Is it possible to tell git send-email to reply to the message with this ID?
--in-reply-to=<identifier>
(although I am fairly sure no-one does that...)
On Thu, Sep 29, 2016 at 6:25 AM, Allan McRae <allan@archlinux.org> wrote:
On 29/09/16 05:29, Patrick Eigensatz wrote:
Ps: Is it possible to tell git send-email to reply to the message with this ID?
--in-reply-to=<identifier>
(although I am fairly sure no-one does that...)
I have used it before. Not sure it's really appreciated or not but the fact that the option is there may imply that some people use it (could be more common on the Kernel mailing list where there is a vast amount of mail and having additional structure helps? I don't know). Cheers, Silvan
On 29/09, Allan McRae wrote:
On 29/09/16 05:29, Patrick Eigensatz wrote:
Ps: Is it possible to tell git send-email to reply to the message with this ID?
--in-reply-to=<identifier>
(although I am fairly sure no-one does that...)
Lots of people use it, and quite a few patches recently sent to this ML has a proper reply-to header. -- Sincerely, Johannes Löthberg PGP Key ID: 0x50FB9B273A9D0BB5 https://theos.kyriasis.com/~kyrias/
'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> --- doc/pacman.8.txt | 6 +++++- src/pacman/database.c | 4 ++++ src/pacman/pacman.c | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt index 2bafa41..0522981 100644 --- a/doc/pacman.8.txt +++ b/doc/pacman.8.txt @@ -456,7 +456,7 @@ Database Options (apply to '-D')[[QO]] package installed even when it was initially installed as a dependency of another package. -*-k \--check*:: +*-k, \--check*:: Check the local package database is internally consistent. This will check all required files are present and that installed packages have the required dependencies, do not conflict and that multiple packages @@ -464,6 +464,10 @@ Database Options (apply to '-D')[[QO]] a check on the sync databases to ensure all specified dependencies are available. +*-q, \--quiet*:: + Apply to '-q' or '--quiet' to suppress the message that the + database check was successful and no errors have been found. + File Options (apply to '-F')[[FO]] ---------------------------------- *-y, --refresh*:: diff --git a/src/pacman/database.c b/src/pacman/database.c index 0197903..3990ea2 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 be52d1b..3881829 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 the success message of the validity check\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; } -- 2.10.0
participants (5)
-
Allan McRae
-
Andrew Gregory
-
Johannes Löthberg
-
Patrick Eigensatz
-
Silvan Jegen