GNU bug report logs -
#35588
guix package --search does not search output names
Previous Next
Reported by: Chris Marusich <cmmarusich <at> gmail.com>
Date: Sun, 5 May 2019 19:40:01 UTC
Severity: normal
Tags: fixed
Done: Chris Marusich <cmmarusich <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello,
Chris Marusich <cmmarusich <at> gmail.com> skribis:
> From c1150a217a416ef4ceccf87c56e36e8e921f873a Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich <at> gmail.com>
> Date: Mon, 6 May 2019 01:51:30 -0700
> Subject: [PATCH] ui: Make package outputs searchable.
>
> * guix/ui.scm (relevance): Allow the "field" procedure of a metric to
> return a list, and handle that case appropriately. Update docstring.
> (%package-metrics): Add a metric for package outputs.
> * guix/scripts/package.scm (find-packages-by-description): Update
> docstring.
>
> Co-authored-by: Tobias Geerinckx-Rice <me <at> tobias.gr>
[...]
> (match (field obj)
> (#f relevance)
> - (str (+ relevance
> - (* (score str) weight)))))))
> + ((? string? str) (+ relevance
> + (* (score str) weight)))
> + ((? list? lst) (+ relevance
> + (* weight
> + (apply + (map score lst)))))))))
Nitpick: it’s a bit subjective, but I think this clause might be
slightly nicer like this:
((lst ...)
(+ relevance (* weight (reduce + 0 (map score lst)))))
Anyway, LGTM!
Thanks,
Ludo’.
This bug report was last modified 6 years and 12 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.