From 953fb66ff3941145b59fca126286b86c8404291f Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 8 Aug 2012 10:20:08 -0500 Subject: [PATCH] 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 Closes: Issue #33 --- pkg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg.c b/pkg.c index 8976ec5..6a8675e 100644 --- a/pkg.c +++ b/pkg.c @@ -809,6 +809,12 @@ pkg_traverse(pkg_t *root, if (maxdepth == 0) 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)) { eflags = pkg_walk_conflicts_list(root, root->conflicts, rflags); @@ -827,12 +833,6 @@ pkg_traverse(pkg_t *root, return eflags; } - if ((root->flags & PKG_PROPF_VIRTUAL) && (flags & PKGF_SKIP_ROOT_VIRTUAL)) - return eflags; - - if (func != NULL) - func(root, data, flags); - return eflags; }