summaryrefslogtreecommitdiff
path: root/lib/libalpm/remove.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-18 22:37:16 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-18 22:37:16 +0000
commitcf94007aed7eb87a38090a62b9ddf606ea1343c9 (patch)
tree828390f91f1e8510522c63d97d9c61cf443bbc24 /lib/libalpm/remove.c
parentc7bcaeb7e82b9b74ab9734863827ff98db2b1fdd (diff)
downloadpacman-cf94007aed7eb87a38090a62b9ddf606ea1343c9.tar.xz
more code cleanup yet
Diffstat (limited to 'lib/libalpm/remove.c')
-rw-r--r--lib/libalpm/remove.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 966df1b6..898969ee 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -56,16 +56,15 @@ int remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ if(pkg_isin(name, trans->packages)) {
+ RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
+ }
+
if((info = db_scan(db, name, INFRQ_ALL)) == NULL) {
_alpm_log(PM_LOG_ERROR, "could not find %s in database", name);
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
}
- if(pkg_isin(info, trans->packages)) {
- FREEPKG(info);
- RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1);
- }
-
_alpm_log(PM_LOG_FLOW2, "adding %s in the targets list", info->name);
trans->packages = pm_list_add(trans->packages, info);
@@ -264,6 +263,13 @@ int remove_commit(pmtrans_t *trans, pmdb_t *db)
if(splitdep((char*)lp->data, &depend)) {
continue;
}
+ /* if this dependency is in the transaction targets, no need to update
+ * its requiredby info: it is in the process of being removed (if not
+ * already done!)
+ */
+ if(pkg_isin(depend.name, trans->packages)) {
+ continue;
+ }
depinfo = db_get_pkgfromcache(db, depend.name);
if(depinfo == NULL) {
/* look for a provides package */