diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | main.c | 12 | ||||
-rw-r--r-- | parse.c | 17 | ||||
-rw-r--r-- | pkg-config.1 | 6 | ||||
-rw-r--r-- | pkg.c | 3 | ||||
-rw-r--r-- | pkg.h | 1 |
6 files changed, 45 insertions, 5 deletions
@@ -1,3 +1,14 @@ +2003-02-15 Havoc Pennington <hp@pobox.com> + + Fixes suggested by Werner Trobin + + * main.c (verbose_error): honor --errors-to-stdout and flush + the same stream we write to + + * parse.c (parse_url): support an "url" field so if someone + has a .pc file they can figure out where to go for newer + versions and such + 2003-01-16 Havoc Pennington <hp@redhat.com> * configure.in: 0.15 @@ -72,7 +72,8 @@ verbose_error (const char *format, ...) { va_list args; gchar *str; - + FILE* stream; + g_return_if_fail (format != NULL); if (!want_verbose_errors) @@ -82,8 +83,13 @@ verbose_error (const char *format, ...) str = g_strdup_vprintf (format, args); va_end (args); - fputs (str, stderr); - fflush (stdout); + if (want_stdout_errors) + stream = stdout; + else + stream = stderr; + + fputs (str, stream); + fflush (stream); g_free (str); } @@ -768,7 +768,20 @@ parse_cflags (Package *pkg, const char *str, const char *path) pkg->I_cflags = g_slist_reverse (pkg->I_cflags); pkg->other_cflags = g_slist_reverse (pkg->other_cflags); } - + +static void +parse_url (Package *pkg, const char *str, const char *path) +{ + if (pkg->url != NULL) + { + verbose_error ("URL field occurs twice in '%s'\n", path); + + exit (1); + } + + pkg->url = trim_and_sub (pkg, str, path); +} + static void parse_line (Package *pkg, const char *untrimmed, const char *path) { @@ -819,6 +832,8 @@ parse_line (Package *pkg, const char *untrimmed, const char *path) parse_cflags (pkg, p, path); else if (strcmp (tag, "Conflicts") == 0) parse_conflicts (pkg, p, path); + else if (strcmp (tag, "URL") == 0) + parse_url (pkg, p, path); else { verbose_error ("Unknown keyword '%s' in '%s'\n", diff --git a/pkg-config.1 b/pkg-config.1 index 6efca10..b7e43b3 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -291,7 +291,8 @@ includedir=${prefix}/include Name: GObject # human-readable name Description: Object/type system for GLib # human-readable description -Version: 1.3.1 +Version: 1.3.1 +URL: http://www.gtk.org Requires: glib-2.0 = 1.3.1 Conflicts: foobar <= 4.5 Libs: -L${libdir} -lgobject-1.3 @@ -322,6 +323,9 @@ it is not the name passed as an argument to \fIpkg-config\fP. .I "Description:" This should be a brief description of the package .TP +.I "URL:" +An URL where people can get more information about and download the package +.TP .I "Version:" This should be the most-specific-possible package version string. .TP @@ -730,6 +730,9 @@ verify_package (Package *pkg) ver->version, req->name, req->version); + if (req->url) + verbose_error ("You may find new versions of %s at %s\n", + req->name, req->url); exit (1); } @@ -54,6 +54,7 @@ struct _Package char *name; /* human-readable name */ char *version; char *description; + char *url; char *pcfiledir; /* directory it was loaded from */ GSList *requires; GSList *l_libs; |