Message ID | 86wn9na82p.fsf@gmail.com |
---|---|
State | New |
Headers | show |
Series | [bug#58136] ui: Improve sort order when searching package names. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
> + ;; For packages with a language prefix (namespaces), also compare the You missed "minetest-" On 28-09-2022 16:26, zimoun wrote: > 3. use upstream-name if provided > > WDYT? For the Minetest mods (which have upstream-names like "Jeija/mesecons"), I don't think think the upstream-name is useful as-is Greetings, Maxime.
On 28-09-2022 22:23, Maxime Devos wrote:
> You missed "minetest-"
Also, "lua-".
Hi, On mer., 28 sept. 2022 at 22:23, Maxime Devos <maximedevos@telenet.be> wrote: > On 28-09-2022 16:26, zimoun wrote: >> 3. use upstream-name if provided > > For the Minetest mods (which have upstream-names like "Jeija/mesecons"), > I don't think think the upstream-name is useful as-is Using the change I am proposing, just knowing ’jeija’ returns a match: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix search jeija name: minetest-mesecons version: 1.2.1-63.27c3c51 outputs: + out: everything else systems: x86_64-linux dependencies: location: gnu/packages/minetest.scm:367:4 homepage: https://mesecons.net license: LGPL 3, CC-BY-SA 3.0 synopsis: Digital circuitry for Minetest, including wires, buttons and lights description: Mesecons is a mod for Minetest implementing various items + related to digital circuitry, such as wires, buttons, lights and programmable + controllers. Among other things, there are also pistons, solar panels, + pressure plates and note blocks. + + Mesecons has a similar goal to Redstone in Minecraft, but works in its own + way, with different rules and mechanics. relevance: 4 --8<---------------cut here---------------end--------------->8--- which is better than nothing. Well, upstream-name is not so much useful as-is but it can help for some cases. Cheers, simon
On 28-09-2022 23:40, zimoun wrote: > Using the change I am proposing, just knowing ’jeija’ returns a match: > > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guix search jeija > name: minetest-mesecons > [...] Right, didn't think of that. Greetings, Maxime.
Hi, zimoun <zimon.toutoune@gmail.com> skribis: > Well, I propose something like see below (based on your patch): > > 1. keep the weight as 4 > 2. set the “namespace” weight to 1 (or 2 if you prefer) > > Otherwise, for example, generic name as CSV could artificially bump > the relevance and hide relevant packages. For instance, compare > > guix search csv > > 3. use upstream-name if provided Maybe something like: (define %package-metrics `((,package-name . 4) (,package-upstream-name* . 4) ;or a lower weight, dunno …)) where: (define (package-upstream-name* package) (or (assoc-ref (package-properties package) 'upstream-name) (package-name-sans-namespace package))) ;strip "r-", "emacs-", etc. WDYT? (Perhaps ‘package-upstream-name’ could be taught about these implicit name conversions done for R, Python, Emacs, etc.?) Ludo’.
Hi, On Sat, 01 Oct 2022 at 23:42, Ludovic Courtès <ludo@gnu.org> wrote: > (define (package-upstream-name* package) > (or (assoc-ref (package-properties package) 'upstream-name) > (package-name-sans-namespace package))) ;strip "r-", "emacs-", etc. I think it is better to rely on ’package-upstream-name’ and hides the plumbing. It helps when something needs to be “refactored“, IMHO. > (Perhaps ‘package-upstream-name’ could be taught about these implicit > name conversions done for R, Python, Emacs, etc.?) Maybe, but it requires to scrutinize importer per importer since upstream name is mainly used by these, IIUC. Cheers, simon
diff --git a/guix/ui.scm b/guix/ui.scm index 55b596ed35..14f296a546 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1655,7 +1655,7 @@ (define (regexp->score regexp) (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a set ;; of regexps. - `((,package-name . 8) + `((,package-name . 4) ;; For packages with a language prefix (namespaces), also compare the ;; unprefixed name, so searching for “ggplot2” yields @@ -1684,9 +1684,9 @@ (define %package-metrics (if (string-prefix? prefix name) (cons (substring name (string-length prefix)) accum) accum)) - '() + (list (package-upstream-name package)) namespaces))) - . 4) + . 1) ;; Match against uncommon outputs. (,(lambda (package)