mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-02-04 15:20:32 +01:00
Silence errors by default with --list-all
When listing all packages, the purpose is to get a quick look at what's installed and not to scrutinize the validity of each .pc file. To see errors from the parser during --list-all, the user can just add --print-errors.
This commit is contained in:
parent
1085ba7377
commit
2f41b2de42
2 changed files with 18 additions and 17 deletions
|
|
@ -11,12 +11,12 @@ RESULT="PKG_CONFIG_DEBUG_SPEW variable enabling debug spew
|
|||
Adding directory '$srcdir' from PKG_CONFIG_PATH
|
||||
Global variable definition 'pc_sysrootdir' = '/'
|
||||
Global variable definition 'pc_top_builddir' = '\$(top_builddir)'
|
||||
Error printing enabled by default due to use of output options besides --exists or --atleast/exact/max-version. Value of --silence-errors: 0
|
||||
Error printing enabled by default due to use of output options besides --exists, --atleast/exact/max-version or --list-all. Value of --silence-errors: 0
|
||||
Error printing enabled
|
||||
$PACKAGE_VERSION"
|
||||
PKG_CONFIG_DEBUG_SPEW=1 run_test --version
|
||||
|
||||
RESULT="Error printing enabled by default due to use of output options besides --exists or --atleast/exact/max-version. Value of --silence-errors: 0
|
||||
RESULT="Error printing enabled by default due to use of output options besides --exists, --atleast/exact/max-version or --list-all. Value of --silence-errors: 0
|
||||
Error printing enabled
|
||||
$PACKAGE_VERSION"
|
||||
run_test --debug --version
|
||||
|
|
|
|||
31
main.c
31
main.c
|
|
@ -571,16 +571,26 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
/* Error printing is determined as follows:
|
||||
* - for all output options besides --exists and --*-version,
|
||||
* it's on by default and --silence-errors can turn it off
|
||||
* - for --exists, --*-version, etc. and no options at all,
|
||||
* - for --exists, --*-version, --list-all and no options at all,
|
||||
* it's off by default and --print-errors will turn it on
|
||||
* - for all other output options, it's on by default and
|
||||
* --silence-errors can turn it off
|
||||
*/
|
||||
if (!want_exists)
|
||||
if (want_exists || want_list)
|
||||
{
|
||||
debug_spew ("Error printing disabled by default due to use of output "
|
||||
"options --exists, --atleast/exact/max-version, "
|
||||
"--list-all or no output option at all. Value of "
|
||||
"--print-errors: %d\n",
|
||||
want_verbose_errors);
|
||||
|
||||
/* Leave want_verbose_errors unchanged, reflecting --print-errors */
|
||||
}
|
||||
else
|
||||
{
|
||||
debug_spew ("Error printing enabled by default due to use of output "
|
||||
"options besides --exists or --atleast/exact/max-version. "
|
||||
"Value of --silence-errors: %d\n",
|
||||
"options besides --exists, --atleast/exact/max-version or "
|
||||
"--list-all. Value of --silence-errors: %d\n",
|
||||
want_silence_errors);
|
||||
|
||||
if (want_silence_errors && getenv ("PKG_CONFIG_DEBUG_SPEW") == NULL)
|
||||
|
|
@ -588,15 +598,6 @@ main (int argc, char **argv)
|
|||
else
|
||||
want_verbose_errors = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
debug_spew ("Error printing disabled by default due to use of output "
|
||||
"options --exists, --atleast/exact/max-version or no "
|
||||
"output option at all. Value of --print-errors: %d\n",
|
||||
want_verbose_errors);
|
||||
|
||||
/* Leave want_verbose_errors unchanged, reflecting --print-errors */
|
||||
}
|
||||
|
||||
if (want_verbose_errors)
|
||||
debug_spew ("Error printing enabled\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue