diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 36d47348f1..d4309094e8 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -417,8 +417,11 @@ current settings and report only settings not already effective." (define manifest-entry->package (match-lambda (($ name version) - (match (append (find-packages-by-name name version) - (find-packages-by-name name)) + ;; Use 'find-best-packages-by-name' and not 'find-packages-by-name'; + ;; the former traverses the module tree only once and then allows for + ;; efficient access via a vhash. + (match (or (find-best-packages-by-name name version) + (find-best-packages-by-name name #f)) ((p _ ...) p) (_ #f)))))