summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-01-13 12:27:17 -0600
committerDan McGee <dan@archlinux.org>2008-01-13 12:27:17 -0600
commit521de7ceedc6e4f5df52c0380f536a6f13a7f578 (patch)
tree1b6d86158a19b3156c23cb81ee90f291ca85f9b3 /lib/libalpm
parent4f267017936471c8248a85f8d86aabb96e66c7e8 (diff)
parentbbe02ec57fd56670dfe0bc08d981ce8a1aa31370 (diff)
downloadpacman-521de7ceedc6e4f5df52c0380f536a6f13a7f578.tar.xz
Merge branch 'maint'
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/deps.c20
-rw-r--r--lib/libalpm/remove.c4
-rw-r--r--lib/libalpm/util.c2
3 files changed, 15 insertions, 11 deletions
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index d839c6b1..46cdc0c3 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -235,7 +235,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps,
alpm_list_t *remove, alpm_list_t *upgrade)
{
alpm_list_t *i, *j;
- alpm_list_t *joined, *dblist;
+ alpm_list_t *targets, *dblist = NULL, *modified = NULL;
alpm_list_t *baddeps = NULL;
pmdepmissing_t *miss = NULL;
@@ -245,9 +245,16 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps,
return(NULL);
}
- joined = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade));
- dblist = alpm_list_diff(_alpm_db_get_pkgcache(db), joined, _alpm_pkg_cmp);
- alpm_list_free(joined);
+ targets = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade));
+ for(i = _alpm_db_get_pkgcache(db); i; i = i->next) {
+ void *pkg = i->data;
+ if(alpm_list_find(targets, pkg, _alpm_pkg_cmp)) {
+ modified = alpm_list_add(modified, pkg);
+ } else {
+ dblist = alpm_list_add(dblist, pkg);
+ }
+ }
+ alpm_list_free(targets);
/* look for unsatisfied dependencies of the upgrade list */
for(i = upgrade; i; i = i->next) {
@@ -275,9 +282,6 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps,
if(reversedeps) {
/* reversedeps handles the backwards dependencies, ie,
* the packages listed in the requiredby field. */
-
- alpm_list_t *modified = alpm_list_diff(_alpm_db_get_pkgcache(db), dblist, _alpm_pkg_cmp);
-
for(i = dblist; i; i = i->next) {
pmpkg_t *lp = i->data;
for(j = alpm_pkg_get_depends(lp); j; j = j->next) {
@@ -297,8 +301,8 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(pmdb_t *db, int reversedeps,
}
}
}
- alpm_list_free(modified);
}
+ alpm_list_free(modified);
alpm_list_free(dblist);
return(baddeps);
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 086ed733..10a055bb 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -147,7 +147,9 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
_alpm_recursedeps(db, trans->packages, 0);
}
- EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
+ if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
+ EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
+ }
return(0);
}
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 64006d1f..d09b9b14 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -582,9 +582,7 @@ const char *_alpm_filecache_setup(void)
}
/* we didn't find a valid cache directory. use /tmp. */
- i = alpm_option_get_cachedirs();
tmp = alpm_list_add(NULL, strdup("/tmp/"));
- FREELIST(i);
alpm_option_set_cachedirs(tmp);
_alpm_log(PM_LOG_DEBUG, "using cachedir: %s", "/tmp/\n");
_alpm_log(PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n"));