pkg: ensure libs.private merging is always after libs

pull/36/head
William Pitcock 2012-08-08 11:15:13 -05:00
parent 3e03f2d9aa
commit 390ff275c5
1 changed files with 14 additions and 5 deletions

19
pkg.c
View File

@ -860,15 +860,21 @@ pkg_libs_collect(pkg_t *pkg, void *data, unsigned int flags)
{
pkg_fragment_t **list = data;
pkg_fragment_t *frag;
(void) flags;
PKG_FOREACH_LIST_ENTRY(pkg->libs, frag)
*list = pkg_fragment_copy(*list, frag);
}
if (flags & PKGF_MERGE_PRIVATE_FRAGMENTS)
{
PKG_FOREACH_LIST_ENTRY(pkg->libs_private, frag)
*list = pkg_fragment_copy(*list, frag);
}
static void
pkg_libs_private_collect(pkg_t *pkg, void *data, unsigned int flags)
{
pkg_fragment_t **list = data;
pkg_fragment_t *frag;
(void) flags;
PKG_FOREACH_LIST_ENTRY(pkg->libs_private, frag)
*list = pkg_fragment_copy(*list, frag);
}
pkg_fragment_t *
@ -876,5 +882,8 @@ pkg_libs(pkg_t *root, pkg_fragment_t **list, int maxdepth, unsigned int flags)
{
pkg_traverse(root, pkg_libs_collect, list, maxdepth, flags);
if (flags & PKGF_MERGE_PRIVATE_FRAGMENTS)
pkg_traverse(root, pkg_libs_private_collect, list, maxdepth, flags);
return *list;
}