From: Arch Librarian Date: Thu, 14 Jul 2005 13:06:19 +0000 (+0000) Subject: 2005-03-18 Tollef Fog Heen X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03723d4caa2d0b9294b248c3cf9c4b8d1c2a73b4;p=pkg-config 2005-03-18 Tollef Fog Heen Author: tfheen Date: 2005-03-22 08:54:08 GMT 2005-03-18 Tollef Fog Heen * pkg.c (print_package_list): Ignore requires when just listing the available packages. (internal_get_package): Pass ignore_requires on. * parse.h: update prototype for parse_package_file. * parse.c (parse_line): Ignore Requires when told so. (parse_package_file): Pass ingore_requires on to parse_line. (Freedesktop #191, Debian #232719) --- diff --git a/ChangeLog b/ChangeLog index 2617fe9..7e5599c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-03-18 Tollef Fog Heen + + * pkg.c (print_package_list): Ignore requires when just listing + the available packages. + (internal_get_package): Pass ignore_requires on. + + * parse.h: update prototype for parse_package_file. + + * parse.c (parse_line): Ignore Requires when told so. + (parse_package_file): Pass ingore_requires on to parse_line. + + (Freedesktop #191, Debian #232719) + 2005-03-18 Tollef Fog Heen * glib-patches/pthread-config-fix.diff: Add patch to detect diff --git a/parse.c b/parse.c index db73a64..5fb45f6 100644 --- a/parse.c +++ b/parse.c @@ -783,7 +783,7 @@ parse_url (Package *pkg, const char *str, const char *path) } static void -parse_line (Package *pkg, const char *untrimmed, const char *path) +parse_line (Package *pkg, const char *untrimmed, const char *path, gboolean ignore_requires) { char *str; char *p; @@ -824,7 +824,12 @@ parse_line (Package *pkg, const char *untrimmed, const char *path) else if (strcmp (tag, "Version") == 0) parse_version (pkg, p, path); else if (strcmp (tag, "Requires") == 0) - parse_requires (pkg, p, path); + { + if (ignore_requires == FALSE) + parse_requires (pkg, p, path); + else + return; + } else if (strcmp (tag, "Libs") == 0) parse_libs (pkg, p, path); else if (strcmp (tag, "Cflags") == 0 || @@ -925,7 +930,7 @@ parse_line (Package *pkg, const char *untrimmed, const char *path) } Package* -parse_package_file (const char *path) +parse_package_file (const char *path, gboolean ignore_requires) { FILE *f; Package *pkg; @@ -962,7 +967,7 @@ parse_package_file (const char *path) { one_line = TRUE; - parse_line (pkg, str->str, path); + parse_line (pkg, str->str, path, ignore_requires); g_string_truncate (str, 0); } diff --git a/parse.h b/parse.h index 96d178e..e538c28 100644 --- a/parse.h +++ b/parse.h @@ -22,7 +22,7 @@ #include "pkg.h" -Package *parse_package_file (const char *path); +Package *parse_package_file (const char *path, gboolean ignore_requires); Package *get_compat_package (const char *name); diff --git a/pkg.c b/pkg.c index 632c4f6..0a327d1 100644 --- a/pkg.c +++ b/pkg.c @@ -61,6 +61,7 @@ static GSList *search_dirs = NULL; static int scanned_dir_count = 0; gboolean disable_uninstalled = FALSE; +gboolean ignore_requires = FALSE; void add_search_dir (const char *path) @@ -311,7 +312,7 @@ internal_get_package (const char *name, gboolean warn, gboolean check_compat) } debug_spew ("Reading '%s' from file '%s'\n", name, location); - pkg = parse_package_file (location); + pkg = parse_package_file (location, ignore_requires); if (pkg == NULL) { @@ -1436,6 +1437,8 @@ print_package_list (void) { int mlen = 0; + ignore_requires = TRUE; + g_hash_table_foreach (locations, max_len_foreach, &mlen); g_hash_table_foreach (locations, packages_foreach, GINT_TO_POINTER (mlen + 1)); }