+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
}
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;
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 ||
}
Package*
-parse_package_file (const char *path)
+parse_package_file (const char *path, gboolean ignore_requires)
{
FILE *f;
Package *pkg;
{
one_line = TRUE;
- parse_line (pkg, str->str, path);
+ parse_line (pkg, str->str, path, ignore_requires);
g_string_truncate (str, 0);
}
#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);
static int scanned_dir_count = 0;
gboolean disable_uninstalled = FALSE;
+gboolean ignore_requires = FALSE;
void
add_search_dir (const char *path)
}
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)
{
{
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));
}