a3083f7dc4
the embedded glib and instead depend on external glib...which depends on pkg-config...
69 lines
1.8 KiB
Plaintext
69 lines
1.8 KiB
Plaintext
$OpenBSD: patch-pkg_c,v 1.9 2011/07/08 17:57:44 jasper Exp $
|
|
--- pkg.c.orig Sun May 15 14:04:08 2011
|
|
+++ pkg.c Fri Jul 8 19:52:01 2011
|
|
@@ -379,7 +379,55 @@ get_package_quiet (const char *name)
|
|
return internal_get_package (name, FALSE);
|
|
}
|
|
|
|
+/*
|
|
+ If certain directories are present, move them to the end of the list
|
|
+ to avoid conflicts.
|
|
+*/
|
|
static GSList*
|
|
+string_list_fix_local_I_dirs (GSList *list)
|
|
+{
|
|
+ GSList *iter;
|
|
+ GSList *local_I_dirs = NULL;
|
|
+ GSList *local_I_dir_iter = NULL;
|
|
+ GSList *found_dirs = NULL;
|
|
+
|
|
+ iter = list;
|
|
+
|
|
+ local_I_dirs = g_slist_append (local_I_dirs, g_strdup_printf ("-I%s/include", LOCALBASE));
|
|
+ local_I_dirs = g_slist_append (local_I_dirs, g_strdup_printf ("-I%s/include", X11BASE));
|
|
+
|
|
+ while (iter != NULL)
|
|
+ {
|
|
+ local_I_dir_iter = local_I_dirs;
|
|
+ while (local_I_dir_iter != NULL)
|
|
+ {
|
|
+ if (strcmp (local_I_dir_iter->data, iter->data) == 0)
|
|
+ {
|
|
+ debug_spew ("List contains \"%s\" - moving it to the end\n", (gchar *)iter->data);
|
|
+ found_dirs = g_slist_append (found_dirs, iter->data);
|
|
+ iter->data = NULL;
|
|
+ break;
|
|
+ }
|
|
+ local_I_dir_iter = local_I_dir_iter->next;
|
|
+ }
|
|
+ iter = iter->next;
|
|
+ }
|
|
+
|
|
+ g_slist_free (local_I_dirs);
|
|
+
|
|
+ while (found_dirs != NULL)
|
|
+ {
|
|
+ list = g_slist_remove (list, NULL);
|
|
+ list = g_slist_append (list, found_dirs->data);
|
|
+ found_dirs = found_dirs->next;
|
|
+ }
|
|
+
|
|
+ g_slist_free (found_dirs);
|
|
+
|
|
+ return list;
|
|
+}
|
|
+
|
|
+static GSList*
|
|
string_list_strip_duplicates (GSList *list)
|
|
{
|
|
GHashTable *table;
|
|
@@ -952,6 +1000,8 @@ get_merged (Package *pkg, GetListFunc func, gboolean i
|
|
|
|
g_slist_free (dups_list);
|
|
|
|
+ list = string_list_fix_local_I_dirs (list);
|
|
+
|
|
retval = string_list_to_string (list);
|
|
|
|
g_slist_free (list);
|