diff --git a/lib/repository_findpkg.c b/lib/repository_findpkg.c index fd930f1b..786ef000 100644 --- a/lib/repository_findpkg.c +++ b/lib/repository_findpkg.c @@ -342,6 +342,19 @@ xbps_repository_install_pkg(const char *pkg, bool by_pkgmatch) if ((rv = create_transaction_dictionary()) != 0) goto out; + /* + * Check that this pkg hasn't been added previously into + * the transaction. + */ + if (by_pkgmatch) { + if (xbps_find_pkg_in_dict_by_pkgmatch(trans_dict, + "unsorted_deps", pkg)) + return 0; + } else { + if (xbps_find_pkg_in_dict_by_name(trans_dict, + "unsorted_deps", pkg)) + return 0; + } /* * Set repository in pkg dictionary. */