pkg: ensure libs.private merging is always after libs

William Pitcock 2012-08-08 11:15:13 -05:00
parent f334d6d7d7
commit 4de01dd45b
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 **list = data;
pkg_fragment_t *frag; pkg_fragment_t *frag;
(void) flags;
PKG_FOREACH_LIST_ENTRY(pkg->libs, frag) PKG_FOREACH_LIST_ENTRY(pkg->libs, frag)
*list = pkg_fragment_copy(*list, 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_FOREACH_LIST_ENTRY(pkg->libs_private, frag) {
*list = pkg_fragment_copy(*list, frag); 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_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); 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; return *list;
} }