main: install a trace handler if --debug is specified
parent
c1d7f1a620
commit
276e36fe28
8
main.c
8
main.c
|
@ -55,6 +55,7 @@
|
||||||
#define PKG_DEFINE_PREFIX (((uint64_t) 1) << 35)
|
#define PKG_DEFINE_PREFIX (((uint64_t) 1) << 35)
|
||||||
#define PKG_DONT_DEFINE_PREFIX (((uint64_t) 1) << 36)
|
#define PKG_DONT_DEFINE_PREFIX (((uint64_t) 1) << 36)
|
||||||
#define PKG_DONT_RELOCATE_PATHS (((uint64_t) 1) << 37)
|
#define PKG_DONT_RELOCATE_PATHS (((uint64_t) 1) << 37)
|
||||||
|
#define PKG_DEBUG (((uint64_t) 1) << 38)
|
||||||
|
|
||||||
static pkgconf_client_t pkg_client;
|
static pkgconf_client_t pkg_client;
|
||||||
|
|
||||||
|
@ -691,7 +692,7 @@ main(int argc, char *argv[])
|
||||||
{ "no-cache", no_argument, &want_flags, PKG_NO_CACHE, },
|
{ "no-cache", no_argument, &want_flags, PKG_NO_CACHE, },
|
||||||
{ "print-provides", no_argument, &want_flags, PKG_PROVIDES, },
|
{ "print-provides", no_argument, &want_flags, PKG_PROVIDES, },
|
||||||
{ "no-provides", no_argument, &want_flags, PKG_NO_PROVIDES, },
|
{ "no-provides", no_argument, &want_flags, PKG_NO_PROVIDES, },
|
||||||
{ "debug", no_argument, &want_flags, 0, },
|
{ "debug", no_argument, &want_flags, PKG_DEBUG|PKG_PRINT_ERRORS, },
|
||||||
{ "validate", no_argument, &want_flags, PKG_VALIDATE|PKG_PRINT_ERRORS|PKG_ERRORS_ON_STDOUT },
|
{ "validate", no_argument, &want_flags, PKG_VALIDATE|PKG_PRINT_ERRORS|PKG_ERRORS_ON_STDOUT },
|
||||||
{ "log-file", required_argument, NULL, 40 },
|
{ "log-file", required_argument, NULL, 40 },
|
||||||
{ "path", no_argument, &want_flags, PKG_PATH },
|
{ "path", no_argument, &want_flags, PKG_PATH },
|
||||||
|
@ -763,9 +764,12 @@ main(int argc, char *argv[])
|
||||||
if (getenv("PKG_CONFIG_DONT_RELOCATE_PATHS"))
|
if (getenv("PKG_CONFIG_DONT_RELOCATE_PATHS"))
|
||||||
want_flags |= (PKG_DONT_RELOCATE_PATHS);
|
want_flags |= (PKG_DONT_RELOCATE_PATHS);
|
||||||
|
|
||||||
if ((want_flags & PKG_VALIDATE) == PKG_VALIDATE)
|
if ((want_flags & PKG_VALIDATE) == PKG_VALIDATE || (want_flags & PKG_DEBUG) == PKG_DEBUG)
|
||||||
pkgconf_client_set_warn_handler(&pkg_client, error_handler, NULL);
|
pkgconf_client_set_warn_handler(&pkg_client, error_handler, NULL);
|
||||||
|
|
||||||
|
if ((want_flags & PKG_DEBUG) == PKG_DEBUG)
|
||||||
|
pkgconf_client_set_trace_handler(&pkg_client, error_handler, NULL);
|
||||||
|
|
||||||
if ((want_flags & PKG_ABOUT) == PKG_ABOUT)
|
if ((want_flags & PKG_ABOUT) == PKG_ABOUT)
|
||||||
{
|
{
|
||||||
about();
|
about();
|
||||||
|
|
Loading…
Reference in New Issue