Skip to content

Commit

Permalink
Add support to generate a log file that keeps track of all requests to
Browse files Browse the repository at this point in the history
pkg-config.  Used by the upcoming pkgtools/verifypc package.  Bump
PKGREVISION to 1.
  • Loading branch information
jmmv committed Oct 1, 2005
1 parent d5c4f27 commit e702620
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
3 changes: 2 additions & 1 deletion devel/pkg-config/Makefile
@@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.1.1.1 2005/07/21 16:22:42 wiz Exp $
# $NetBSD: Makefile,v 1.2 2005/10/01 12:52:16 jmmv Exp $
#

DISTNAME= pkg-config-0.19
PKGREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://pkgconfig.freedesktop.org/releases/

Expand Down
3 changes: 2 additions & 1 deletion devel/pkg-config/distinfo
@@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.1.1.1 2005/07/21 16:22:42 wiz Exp $
$NetBSD: distinfo,v 1.2 2005/10/01 12:52:16 jmmv Exp $

SHA1 (pkg-config-0.19.tar.gz) = b09fa43dcc44fe0db8df1c4994a8ff9eab371666
RMD160 (pkg-config-0.19.tar.gz) = 30355004c09fe947dc3cf8f1159f068924d0d7a2
Size (pkg-config-0.19.tar.gz) = 968790 bytes
SHA1 (patch-aa) = b07ff0f2a8caaef6d91673c1883f0de9d4d2ae7f
SHA1 (patch-ab) = 4554bbb56ffaa857051e44b31897f0b254650803
65 changes: 65 additions & 0 deletions 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);

0 comments on commit e702620

Please sign in to comment.