pkg: pkg_libs(): consider both Libs and Libs.private fragments at the same time instead of separately (fixes many ordering problems with --static) (closes #68)

feature/tap-sh
William Pitcock 2015-05-21 22:14:37 -05:00
parent face849e5f
commit 0e0ab8318b
1 changed files with 6 additions and 20 deletions

26
pkg.c
View File

@ -1039,23 +1039,16 @@ pkg_libs_collect(pkg_t *pkg, void *data, unsigned int flags)
PKG_FOREACH_LIST_ENTRY(pkg->libs.head, node)
{
pkg_fragment_t *frag = node->data;
pkg_fragment_copy(list, frag, flags);
}
}
static void
pkg_libs_private_collect(pkg_t *pkg, void *data, unsigned int flags)
{
pkg_list_t *list = data;
pkg_node_t *node;
(void) flags;
PKG_FOREACH_LIST_ENTRY(pkg->libs_private.head, node)
if (flags & PKGF_MERGE_PRIVATE_FRAGMENTS)
{
pkg_fragment_t *frag = node->data;
pkg_fragment_copy(list, frag, flags);
PKG_FOREACH_LIST_ENTRY(pkg->libs_private.head, node)
{
pkg_fragment_t *frag = node->data;
pkg_fragment_copy(list, frag, flags);
}
}
}
@ -1072,12 +1065,5 @@ pkg_libs(pkg_t *root, pkg_list_t *list, int maxdepth, unsigned int flags)
return eflag;
}
if (flags & PKGF_MERGE_PRIVATE_FRAGMENTS)
{
eflag = pkg_traverse(root, pkg_libs_private_collect, list, maxdepth, flags);
if (eflag != PKG_ERRF_OK)
pkg_fragment_free(list);
}
return eflag;
}