1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

libalpm/package.c : fix requiredby with multiple providers.

The code didn't match the following comment :
"A depends on B through n depends <=> A listed in B's requiredby n times"

It stopped at n=1 with a break.

I was surprised to see this case happens in real, that's how I noticed the
bug: wine depends on both freeglut and glut, while freeglut provides glut.

So when installing wine, the update_depends function listed wine twice in
freeglut's requiredby.  But the compute_requiredby function (used when
installing freeglut, and used by testdb) listed wine only once in
freeglut's requiredby.  That made testdb unhappy.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Chantry Xavier 2007-10-18 13:26:04 +02:00 committed by Dan McGee
parent 619bf56e66
commit 0ff02995f1

View File

@ -527,7 +527,6 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) {
pmdepend_t *dep;
int satisfies;
if(!j->data) {
continue;
@ -537,14 +536,12 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
continue;
}
satisfies = alpm_depcmp(pkg, dep);
FREE(dep);
if(satisfies) {
if(alpm_depcmp(pkg, dep)) {
_alpm_log(PM_LOG_DEBUG, "adding '%s' in requiredby field for '%s'\n",
cachepkgname, pkg->name);
reqs = alpm_list_add(reqs, strdup(cachepkgname));
break;
}
FREE(dep);
}
}
return(reqs);