summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-26 13:29:47 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-03-26 13:29:47 +0000
commit43f4505b1e2be3745468b74771a08cca49148996 (patch)
tree7c90a9dbc2866a7fcb9aa8cabddf63123ae852d2 /lib/libalpm/deps.c
parent10b0e0d9af0e396d30f6fb1f5d321488897746d3 (diff)
downloadpacman-43f4505b1e2be3745468b74771a08cca49148996.tar.xz
More backport from pacman 2.9.5 (mainly for resolvedeps)
Diffstat (limited to 'lib/libalpm/deps.c')
-rw-r--r--lib/libalpm/deps.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 66b72e58..2b117f2e 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -170,6 +170,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
}
if(pkg_isin(p, packages)) {
/* this package is also in the upgrade list, so don't worry about it */
+ FREEPKG(p);
continue;
}
for(k = p->depends; k && !found; k = k->next) {
@@ -185,6 +186,7 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
PMList *provides = _alpm_db_whatprovides(db, depend.name);
if(provides == NULL) {
/* not found */
+ FREEPKG(p);
continue;
}
/* we found an installed package that provides depend.name */
@@ -223,8 +225,9 @@ PMList *checkdeps(pmdb_t *db, unsigned short op, PMList *packages)
baddeps = pm_list_add(baddeps, miss);
}
}
+ FREEPKG(p);
}
- pkg_free(oldpkg);
+ FREEPKG(oldpkg);
}
}
if(op == PM_TRANS_TYPE_ADD || op == PM_TRANS_TYPE_UPGRADE) {
@@ -671,12 +674,38 @@ int resolvedeps(pmdb_t *local, PMList *databases, pmsync_t *sync, PMList *list,
}
if(!found) {
- trail = pm_list_add(trail, sync);
- if(resolvedeps(local, databases, sync, list, trail, data)) {
+ /* check pmo_ignorepkg and pmo_s_ignore to make sure we haven't pulled in
+ * something we're not supposed to.
+ */
+ int usedep = 1;
+ found = 0;
+ /* ORE
+ for(j = pmo_ignorepkg; j && !found; j = j->next) {
+ if(!strcmp(j->data, sync->pkg->name)) {
+ found = 1;
+ }
+ }
+ for(j = pmo_s_ignore; j && !found; j = j->next) {
+ if(!strcmp(j->data, sync->pkg->name)) {
+ found = 1;
+ }
+ }
+ if(found) {
+ usedep = yesno("%s requires %s, but it is in IgnorePkg. Install anyway? [Y/n] ",
+ miss->target, sync->pkg->name);
+ }*/
+ if(usedep) {
+ trail = pm_list_add(trail, sync);
+ if(resolvedeps(local, databases, sync, list, trail, data)) {
+ goto error;
+ }
+ _alpm_log(PM_LOG_FLOW2, "adding %s-%s", sync->spkg->name, sync->spkg->version);
+ list = pm_list_add(list, sync);
+ } else {
+ _alpm_log(PM_LOG_ERROR, "cannot resolve dependencies for \"%s\"", miss->target);
+ pm_errno = PM_ERR_UNRESOLVABLE_DEPS;
goto error;
}
- _alpm_log(PM_LOG_FLOW2, "adding %s-%s", sync->spkg->name, sync->spkg->version);
- list = pm_list_add(list, sync);
} else {
/* cycle detected -- skip it */
_alpm_log(PM_LOG_FLOW2, "dependency cycle detected: %s", sync->spkg->name);