2003-02-15 Havoc Pennington <hp@pobox.com>

Author: hp
Date: 2003-02-15 15:04:07 GMT
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
This commit is contained in:
Arch Librarian 2005-07-14 13:05:41 +00:00
parent 70fbf4c00a
commit 7207c289d8
6 changed files with 45 additions and 5 deletions

View file

@ -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

12
main.c
View file

@ -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);
}

17
parse.c
View file

@ -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",

View file

@ -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

3
pkg.c
View file

@ -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);
}

1
pkg.h
View file

@ -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;