From d8a025a56ad853f9f41a3bf25d8a15197340be7f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 14 Jan 2010 13:57:13 +0100 Subject: [PATCH] xbps_repository_install_pkg: before adding pkg into the transaction, check that it wasn't added before. This change fixes and endless loop while doing the following: $ xbps-bin install libXext libX11 where libX11 is a dependency of libXext and was already queued. --HG-- extra : convert_revision : xtraeme%40gmail.com-20100114125713-o9vxzayz1tnhlt96 --- lib/repository_findpkg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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. */