mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
libalpm/deps.c : improves IgnorePkg handling in resolvedeps.
resolvedeps will now search for other satisfiers when we don't let it add a package from IgnorePkg. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
parent
8f824e70bb
commit
55a7455135
@ -681,8 +681,19 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
|
|||||||
/* find the package in one of the repositories */
|
/* find the package in one of the repositories */
|
||||||
/* check literals */
|
/* check literals */
|
||||||
for(j = dbs_sync; j && !found; j = j->next) {
|
for(j = dbs_sync; j && !found; j = j->next) {
|
||||||
if((sync = _alpm_db_get_pkgfromcache(j->data, missdep->name))) {
|
sync = _alpm_db_get_pkgfromcache(j->data, missdep->name);
|
||||||
|
if(!sync) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
found = alpm_depcmp(sync, missdep);
|
found = alpm_depcmp(sync, missdep);
|
||||||
|
if(!found) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* If package is in the ignorepkg list, ask before we pull it */
|
||||||
|
if(_alpm_pkg_should_ignore(sync)) {
|
||||||
|
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
|
||||||
|
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &found);
|
||||||
|
_alpm_pkg_free(dummypkg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*TODO this autoresolves the first 'satisfier' package... we should fix this
|
/*TODO this autoresolves the first 'satisfier' package... we should fix this
|
||||||
@ -691,7 +702,18 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
|
|||||||
for(j = dbs_sync; j && !found; j = j->next) {
|
for(j = dbs_sync; j && !found; j = j->next) {
|
||||||
for(k = _alpm_db_get_pkgcache(j->data); k && !found; k = k->next) {
|
for(k = _alpm_db_get_pkgcache(j->data); k && !found; k = k->next) {
|
||||||
sync = k->data;
|
sync = k->data;
|
||||||
|
if(!sync) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
found = alpm_depcmp(sync, missdep);
|
found = alpm_depcmp(sync, missdep);
|
||||||
|
if(!found) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(_alpm_pkg_should_ignore(sync)) {
|
||||||
|
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
|
||||||
|
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &found);
|
||||||
|
_alpm_pkg_free(dummypkg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -712,37 +734,13 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
|
|||||||
}
|
}
|
||||||
pm_errno = PM_ERR_UNSATISFIED_DEPS;
|
pm_errno = PM_ERR_UNSATISFIED_DEPS;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
} else {
|
||||||
/* check pmo_ignorepkg and pmo_s_ignore to make sure we haven't pulled in
|
|
||||||
* something we're not supposed to.
|
|
||||||
*/
|
|
||||||
int usedep = 1;
|
|
||||||
if(_alpm_pkg_should_ignore(sync)) {
|
|
||||||
pmpkg_t *dummypkg = _alpm_pkg_new(miss->target, NULL);
|
|
||||||
QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, dummypkg, sync, NULL, &usedep);
|
|
||||||
_alpm_pkg_free(dummypkg);
|
|
||||||
}
|
|
||||||
if(usedep) {
|
|
||||||
_alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n",
|
_alpm_log(PM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n",
|
||||||
alpm_pkg_get_name(sync), alpm_pkg_get_name(syncpkg));
|
alpm_pkg_get_name(sync), alpm_pkg_get_name(syncpkg));
|
||||||
*list = alpm_list_add(*list, sync);
|
*list = alpm_list_add(*list, sync);
|
||||||
if(_alpm_resolvedeps(local, dbs_sync, sync, list, trans, data)) {
|
if(_alpm_resolvedeps(local, dbs_sync, sync, list, trans, data)) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
_alpm_log(PM_LOG_ERROR, _("cannot resolve dependencies for \"%s\"\n"), miss->target);
|
|
||||||
if(data) {
|
|
||||||
if((miss = malloc(sizeof(pmdepmissing_t))) == NULL) {
|
|
||||||
_alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %zd bytes\n"), sizeof(pmdepmissing_t));
|
|
||||||
FREELIST(*data);
|
|
||||||
pm_errno = PM_ERR_MEMORY;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
*miss = *(pmdepmissing_t *)i->data;
|
|
||||||
*data = alpm_list_add(*data, miss);
|
|
||||||
}
|
|
||||||
pm_errno = PM_ERR_UNSATISFIED_DEPS;
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user