diff options
author | jmmv <jmmv> | 2005-10-01 12:52:16 +0000 |
---|---|---|
committer | jmmv <jmmv> | 2005-10-01 12:52:16 +0000 |
commit | a15cca5fd73bc23bb5fbc27e379b6c3a539ed011 (patch) | |
tree | 0c80643c21a6c45a847b7fd21d904baa75645725 /devel/pkg-config/patches | |
parent | b578c44dbbd7ee4dc25ae8da11bc0b3309e255d1 (diff) | |
download | pkgsrc-a15cca5fd73bc23bb5fbc27e379b6c3a539ed011.tar.gz |
Add support to generate a log file that keeps track of all requests to
pkg-config. Used by the upcoming pkgtools/verifypc package. Bump
PKGREVISION to 1.
Diffstat (limited to 'devel/pkg-config/patches')
-rw-r--r-- | devel/pkg-config/patches/patch-ab | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/devel/pkg-config/patches/patch-ab b/devel/pkg-config/patches/patch-ab new file mode 100644 index 00000000000..95d9b304962 --- /dev/null +++ b/devel/pkg-config/patches/patch-ab @@ -0,0 +1,65 @@ +$NetBSD: patch-ab,v 1.1 2005/10/01 12:52:16 jmmv Exp $ + +Log all pkg-config calls to a file. Used by pkgtools/verifypc. + +--- main.c.orig 2005-05-21 11:14:47.000000000 +0200 ++++ main.c +@@ -458,12 +458,27 @@ main (int argc, char **argv) + { + GSList *reqs; + GSList *iter; ++ char *log_name; ++ FILE *log; + + reqs = parse_module_list (NULL, str->str, + "(command line arguments)"); + + iter = reqs; + ++ log_name = getenv ("PKG_CONFIG_LOG"); ++ if (log_name != NULL) ++ { ++ log = fopen (getenv ("PKG_CONFIG_LOG"), "a"); ++ if (log == NULL) ++ { ++ fprintf (stderr, "Cannot open log file: %s\n", log_name); ++ exit (1); ++ } ++ } ++ else ++ log = NULL; ++ + while (iter != NULL) + { + Package *req; +@@ -471,6 +486,18 @@ main (int argc, char **argv) + + req = get_package (ver->name); + ++ if (log != NULL) ++ { ++ if (req == NULL) ++ fprintf (log, "%s NOT-FOUND", ver->name); ++ else ++ fprintf (log, "%s %s %s", ver->name, ++ comparison_to_str (ver->comparison), ++ ver->version); ++ ++ fprintf (log, "\n"); ++ } ++ + if (req == NULL) + { + verbose_error ("No package '%s' found\n", ver->name); +@@ -497,6 +524,11 @@ main (int argc, char **argv) + + iter = g_slist_next (iter); + } ++ ++ if (log != NULL) ++ { ++ fclose (log); ++ } + } + + g_string_free (str, TRUE); |