pkg: fix backwards root-leaf traversal order.

This bug causes occasional problems when calculating inter-module dependencies in complex
dependency graphs, such as ffmpeg when cross-compiled.

Reported-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Closes: Issue #33
pull/36/head
William Pitcock 2012-08-08 10:20:08 -05:00
parent 56ba08b617
commit 953fb66ff3
1 changed files with 6 additions and 6 deletions

12
pkg.c
View File

@ -809,6 +809,12 @@ pkg_traverse(pkg_t *root,
if (maxdepth == 0) if (maxdepth == 0)
return eflags; return eflags;
if ((root->flags & PKG_PROPF_VIRTUAL) != PKG_PROPF_VIRTUAL || (flags & PKGF_SKIP_ROOT_VIRTUAL) != PKGF_SKIP_ROOT_VIRTUAL)
{
if (func != NULL)
func(root, data, flags);
}
if (!(flags & PKGF_SKIP_CONFLICTS)) if (!(flags & PKGF_SKIP_CONFLICTS))
{ {
eflags = pkg_walk_conflicts_list(root, root->conflicts, rflags); eflags = pkg_walk_conflicts_list(root, root->conflicts, rflags);
@ -827,12 +833,6 @@ pkg_traverse(pkg_t *root,
return eflags; return eflags;
} }
if ((root->flags & PKG_PROPF_VIRTUAL) && (flags & PKGF_SKIP_ROOT_VIRTUAL))
return eflags;
if (func != NULL)
func(root, data, flags);
return eflags; return eflags;
} }