Florian Paul Schmidt <[email protected]> skribis:
> +(define (find-guix-packages list-of-names)
> + (map
> + car
> + (map
> + find-packages-by-name
> + list-of-names)))
[...]
> I am aware that is maybe still too simplistic. E.g.: It might be good
> to check if the name is ambiguous instead of just taking the first
> result and throw an error in that case.
Indeed. ;-)
> As a typical programmer I am allergic to seemingly redundant and
> automatable tasks, so I'd love to see something at least similar in
> spirit in guix.
I can sympathize with this.
I think ‘specification->package’ from (gnu packages) is the procedure
you want. Like this:
(map specification->package
'("guile-2" "gnupg-2.0" "coreutils"))
It emits a warning in case the specification is ambiguous.
Maybe we could/should use it in the example GuixSD configurations, and
at least document it somewhere.
WDYT?
Thanks,
Ludo’.