perl -p -i.bak -e "s/info_TEXINFOS/noinst_TEXINFOS/g" `find glib-1.2.8 -name Makefile.am`
perl -p -i.bak -e "s/man_MANS/noinst_MANS/g" `find glib-1.2.8 -name Makefile.am`
+## patch gslist.c to have stable sort
+perl -p -w -i.bak -e 's/if \(compare_func\(l1->data,l2->data\) < 0\)/if \(compare_func\(l1->data,l2->data\) <= 0\)/g' glib-1.2.8/gslist.c
+
(cd glib-1.2.8 && libtoolize --copy --force && $ACLOCAL $ACLOCAL_FLAGS && $AUTOMAKE && autoconf)
if test -z "$*"; then
nodups = g_slist_prepend (nodups, tmp->data);
g_hash_table_insert (table, tmp->data, tmp->data);
}
+ else
+ {
+ debug_spew (" removing duplicate \"%s\"\n", tmp->data);
+ }
tmp = g_slist_next (tmp);
}
nodups = g_slist_prepend (nodups, tmp->data);
g_hash_table_insert (table, tmp->data, tmp->data);
}
-
+ else
+ {
+ debug_spew (" removing duplicate (from back) \"%s\"\n", tmp->data);
+ }
+
tmp = g_slist_next (tmp);
}
{
const Package *pa = a;
const Package *pb = b;
-
+
if (pa->path_position < pb->path_position)
return -1;
else if (pa->path_position > pb->path_position)
return 0;
}
+static void
+spew_package_list (const char *name,
+ GSList *list)
+{
+ GSList *tmp;
+
+ debug_spew (" %s: ", name);
+
+ tmp = list;
+ while (tmp != NULL)
+ {
+ Package *pkg = tmp->data;
+ debug_spew (" %s ", pkg->name);
+ tmp = tmp->next;
+ }
+ debug_spew ("\n");
+}
+
+static void
+spew_string_list (const char *name,
+ GSList *list)
+{
+ GSList *tmp;
+
+ debug_spew (" %s: ", name);
+
+ tmp = list;
+ while (tmp != NULL)
+ {
+ debug_spew (" %s ", tmp->data);
+ tmp = tmp->next;
+ }
+ debug_spew ("\n");
+}
+
static GSList*
packages_sort_by_path_position (GSList *list)
{
packages = g_slist_append (packages, pkg);
recursive_fill_list (pkg, get_requires, &packages);
+ spew_package_list ("original", packages);
+
packages = packages_sort_by_path_position (packages);
+ spew_package_list ("sorted", packages);
+
tmp = packages;
while (tmp != NULL)
{
tmp = tmp->next;
}
+ spew_package_list ("original", expanded);
+
expanded = packages_sort_by_path_position (expanded);
+ spew_package_list ("sorted", expanded);
+
tmp = expanded;
while (tmp != NULL)
{