pkg: ensure libs.private merging is always after libs

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

13
pkg.c
View File

@ -860,21 +860,30 @@ 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)
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 *
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;
}