diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-04-24 23:27:35 +0200 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-04-24 23:27:35 +0200 |
commit | 49257b49f9dce71f8c5970d20e3a41e4541b70e8 (patch) | |
tree | 6c53877378bf62b5ccb54bfcca319c740e947830 | |
parent | 7c04fe95ac822f435790aafeeeb9a91dd82f87be (diff) | |
download | pacman-49257b49f9dce71f8c5970d20e3a41e4541b70e8.tar.gz pacman-49257b49f9dce71f8c5970d20e3a41e4541b70e8.tar.xz |
avoided to load twice the same target in remove_loadtarget()
-rw-r--r-- | lib/libalpm/remove.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 279e2cb9..e42035ee 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -56,10 +56,17 @@ int remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) /* ORE we should better find the package in the cache, and then perform a db_read(INFRQ_FILES) to add files information to it. */ + _alpm_log(PM_LOG_FLOW2, "loading target %s", name); 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); + } + trans->packages = pm_list_add(trans->packages, info); return(0); |