index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Michael Straube <michael.straube@posteo.de> | 2018-12-14 21:44:24 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-01-04 11:31:55 +1000 |
commit | 3a5a0d53bced32b42fd553952c2f74d52981d9ef (patch) | |
tree | d5c520c877e4b1559193ffcea63c79e9f1e05ea2 /lib | |
parent | 984492b92f1b35534adddc24c2439fcdcb9885af (diff) |
-rw-r--r-- | lib/libalpm/add.c | 8 | ||||
-rw-r--r-- | lib/libalpm/remove.c | 3 |
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index e415bb17..c39f9ecf 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -53,6 +53,7 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) const char *pkgname, *pkgver; alpm_trans_t *trans; alpm_pkg_t *local; + alpm_pkg_t *dup; /* Sanity checks */ CHECK_HANDLE(handle, return -1); @@ -70,7 +71,12 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) _alpm_log(handle, ALPM_LOG_DEBUG, "adding package '%s'\n", pkgname); - if(alpm_pkg_find(trans->add, pkgname)) { + if((dup = alpm_pkg_find(trans->add, pkgname))) { + if(dup == pkg) { + _alpm_log(handle, ALPM_LOG_DEBUG, "skipping duplicate target: %s\n", pkgname); + return 0; + } + /* error for separate packages with the same name */ RET_ERR(handle, ALPM_ERR_TRANS_DUP_TARGET, -1); } diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 78ca5be7..50de4649 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -74,7 +74,8 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) pkgname = pkg->name; if(alpm_pkg_find(trans->remove, pkgname)) { - RET_ERR(handle, ALPM_ERR_TRANS_DUP_TARGET, -1); + _alpm_log(handle, ALPM_LOG_DEBUG, "skipping duplicate target: %s\n", pkgname); + return 0; } _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s to the transaction remove list\n", |