Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c8
1 files changed, 7 insertions, 1 deletions
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);
}