2005-03-18 Tollef Fog Heen <tfheen@debian.org>

Author: tfheen
Date: 2005-03-22 08:54:08 GMT
2005-03-18  Tollef Fog Heen  <tfheen@debian.org>

       * 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)
This commit is contained in:
Arch Librarian 2005-07-14 13:06:19 +00:00
parent 3c5248e621
commit 03723d4caa
4 changed files with 27 additions and 6 deletions

View file

@ -1,3 +1,16 @@
2005-03-18 Tollef Fog Heen <tfheen@debian.org>
* 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 <tfheen@err.no>
* glib-patches/pthread-config-fix.diff: Add patch to detect

13
parse.c
View file

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

View file

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

5
pkg.c
View file

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