packages: Remove duplicates from package cache.
authorLudovic Courtès <ludo@gnu.org>
Fri, 15 Feb 2019 21:58:29 +0000 (22:58 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sat, 16 Feb 2019 00:00:08 +0000 (01:00 +0100)
commit36754eee28187b41e9a6ef15cd3c9911449a4e8d
tree6ddea122d835508372e1018e97529e68ce58acf7
parentba48895899a117d6ace2209c3f54411a4a989133
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.
gnu/packages.scm
tests/packages.scm