1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
$NetBSD: patch-ab,v 1.2 2005/10/16 21:51:29 jmmv Exp $
Log all pkg-config calls to a file. Used by pkgtools/verifypc.
--- main.c.orig 2005-10-16 23:42:25.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 == NULL) ? "(null)" : 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);
|