Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authormorganamilo <morganamilo@gmail.com>2019-09-08 22:45:27 +0100
committerAllan McRae <allan@archlinux.org>2019-10-07 12:12:04 +1000
commitb4e4b74acea3d652317b030e761300d5c7b437a2 (patch)
treeaa69bbf8ec97325e6b1ec67c41a552a16c1e6696 /lib/libalpm/deps.c
parentbcacb00fc89c04ec0b5e7ebefe3b605b266cef57 (diff)
libalpm: resolvedep(): don't compare names twice
If we failed to get the pkg from pkgcache then we know no satisfying package exists by name. So only compare provides. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 71185c68..6f923b2e 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -699,7 +699,8 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep,
for(j = _alpm_db_get_pkgcache(db); j; j = j->next) {
alpm_pkg_t *pkg = j->data;
if((pkg->name_hash != dep->name_hash || strcmp(pkg->name, dep->name) != 0)
- && _alpm_depcmp(pkg, dep) && !alpm_pkg_find(excluding, pkg->name)) {
+ && _alpm_depcmp_provides(dep, alpm_pkg_get_provides(pkg))
+ && !alpm_pkg_find(excluding, pkg->name)) {
if(alpm_pkg_should_ignore(handle, pkg)) {
alpm_question_install_ignorepkg_t question = {
.type = ALPM_QUESTION_INSTALL_IGNOREPKG,