pkg: improve conflicts handling

William Pitcock 2012-07-30 02:46:03 -05:00
parent fdbd97b23a
commit 8f3548c38f
2 changed files with 21 additions and 15 deletions

10
pkg.c
View File

@ -756,13 +756,18 @@ static inline unsigned int
pkg_walk_conflicts_list(pkg_t *root, pkg_dependency_t *deplist, unsigned int flags)
{
unsigned int eflags;
pkg_dependency_t *node;
pkg_dependency_t *node, *depnode;
PKG_FOREACH_LIST_ENTRY(deplist, node)
{
if (*node->package == '\0')
continue;
PKG_FOREACH_LIST_ENTRY(root->requires, depnode)
{
pkg_t *pkgdep;
if (*node->package == '\0')
if (*depnode->package == '\0' || strcmp(depnode->package, node->package))
continue;
pkgdep = pkg_verify_dependency(node, flags, &eflags);
@ -781,6 +786,7 @@ pkg_walk_conflicts_list(pkg_t *root, pkg_dependency_t *deplist, unsigned int fla
pkg_free(pkgdep);
}
}
return PKG_ERRF_OK;
}

View File

@ -129,7 +129,7 @@ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 PKG_CONFIG_SYSROOT_DIR=/test ${1} --cf
# 8) tests for 'Conflicts'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs conflicts; echo \$?" \
'1'
'0'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --ignore-conflicts --libs conflicts; echo \$?" \
'-lconflicts' '0'