From 36754eee28187b41e9a6ef15cd3c9911449a4e8d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 15 Feb 2019 22:58:29 +0100 Subject: packages: Remove duplicates from package cache. Previously the same package could appear several times if several variables were bound to it, as is notably the case for "python" currently. This, in turn, would lead to obnoxious "ambiguous package specification" messages. * gnu/packages.scm (generate-package-cache)[expand-cache]: Change RESULT to RESULT+SEEN and adjust accordingly. Call 'first' on the result of 'fold-module-public-variables*'. * tests/packages.scm ("fold-available-packages with/without cache"): Check for lack of duplicates in FROM-CACHE. --- tests/packages.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/packages.scm b/tests/packages.scm index e5704ae4b9..4e4bffc48c 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1037,7 +1037,8 @@ result)) '())))))) - (lset= equal? no-cache from-cache))) + (and (equal? (delete-duplicates from-cache) from-cache) + (lset= equal? no-cache from-cache)))) (test-assert "find-packages-by-name" (match (find-packages-by-name "hello") -- cgit 1.4.1