mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-02-04 02:30:26 +01:00
2002-02-07 Havoc Pennington <hp@redhat.com>
Author: hp Date: 2002-02-07 19:54:49 GMT 2002-02-07 Havoc Pennington <hp@redhat.com> * autogen.sh: patch gslist.c so that it has a stable sort function, so we don't utterly mangle the order of the libraries on the link line.
This commit is contained in:
parent
253c67066f
commit
fa090373fc
3 changed files with 62 additions and 2 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2002-02-07 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* autogen.sh: patch gslist.c so that it has a stable sort
|
||||
function, so we don't utterly mangle the order of the libraries on
|
||||
the link line.
|
||||
|
||||
2002-02-03 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* configure.in: 0.10.0
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ perl -p -i.bak -e "s/[a-zA-Z0-9]+_DATA/noinst_DATA/g" `find glib-1.2.8 -name Mak
|
|||
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
|
||||
|
|
|
|||
55
pkg.c
55
pkg.c
|
|
@ -331,6 +331,10 @@ string_list_strip_duplicates (GSList *list)
|
|||
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);
|
||||
}
|
||||
|
|
@ -363,7 +367,11 @@ string_list_strip_duplicates_from_back (GSList *list)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
@ -433,7 +441,7 @@ pathposcmp (gconstpointer a, gconstpointer b)
|
|||
{
|
||||
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)
|
||||
|
|
@ -442,6 +450,41 @@ pathposcmp (gconstpointer a, gconstpointer b)
|
|||
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)
|
||||
{
|
||||
|
|
@ -488,8 +531,12 @@ fill_list_in_path_order_single_package (Package *pkg, GetListFunc func,
|
|||
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)
|
||||
{
|
||||
|
|
@ -518,8 +565,12 @@ fill_list_in_path_order (GSList *packages, GetListFunc func,
|
|||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue