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>
This commit is contained in:
parent
e83e868a77
commit
46324d9b26
3 changed files with 14 additions and 1 deletions
|
@ -456,7 +456,7 @@ Database Options (apply to '-D')[[QO]]
|
||||||
package installed even when it was initially installed as a dependency
|
package installed even when it was initially installed as a dependency
|
||||||
of another package.
|
of another package.
|
||||||
|
|
||||||
*-k \--check*::
|
*-k, \--check*::
|
||||||
Check the local package database is internally consistent. This will
|
Check the local package database is internally consistent. This will
|
||||||
check all required files are present and that installed packages have
|
check all required files are present and that installed packages have
|
||||||
the required dependencies, do not conflict and that multiple packages
|
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
|
a check on the sync databases to ensure all specified dependencies
|
||||||
are available.
|
are available.
|
||||||
|
|
||||||
|
*-q, \--quiet*::
|
||||||
|
Apply to '-q' or '--quiet' to suppress messages on successful
|
||||||
|
completion of database operations.
|
||||||
|
|
||||||
File Options (apply to '-F')[[FO]]
|
File Options (apply to '-F')[[FO]]
|
||||||
----------------------------------
|
----------------------------------
|
||||||
*-y, --refresh*::
|
*-y, --refresh*::
|
||||||
|
|
|
@ -286,6 +286,10 @@ int pacman_database(alpm_list_t *targets)
|
||||||
} else {
|
} else {
|
||||||
ret = check_db_sync();
|
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)) {
|
if(config->flags & (ALPM_TRANS_FLAG_ALLDEPS | ALPM_TRANS_FLAG_ALLEXPLICIT)) {
|
||||||
|
|
|
@ -171,6 +171,7 @@ static void usage(int op, const char * const myname)
|
||||||
addlist(_(" --asdeps mark packages as non-explicitly installed\n"));
|
addlist(_(" --asdeps mark packages as non-explicitly installed\n"));
|
||||||
addlist(_(" --asexplicit mark packages as 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(_(" -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) {
|
} else if(op == PM_OP_DEPTEST) {
|
||||||
printf("%s: %s {-T --deptest} [%s] [%s]\n", str_usg, myname, str_opt, str_pkg);
|
printf("%s: %s {-T --deptest} [%s] [%s]\n", str_usg, myname, str_opt, str_pkg);
|
||||||
printf("%s:\n", str_opt);
|
printf("%s:\n", str_opt);
|
||||||
|
@ -466,6 +467,10 @@ static int parsearg_database(int opt)
|
||||||
case 'k':
|
case 'k':
|
||||||
(config->op_q_check)++;
|
(config->op_q_check)++;
|
||||||
break;
|
break;
|
||||||
|
case OP_QUIET:
|
||||||
|
case 'q':
|
||||||
|
config->quiet = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue