mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-06 23:16:13 -05:00
ui: Take package upstream name into account when searching.
* guix/ui.scm (%package-metrics): Add PACKAGE-UPSTREAM-NAME*. * tests/ui.scm ("package-relevance and upstream name"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
052faadde7
commit
bbcd06e56c
2 changed files with 11 additions and 1 deletions
|
@ -1668,6 +1668,7 @@ (define %package-metrics
|
|||
;; Metrics used to compute the "relevance score" of a package against a set
|
||||
;; of regexps.
|
||||
`((,package-name . 4)
|
||||
(,package-upstream-name* . 2)
|
||||
|
||||
;; Match against uncommon outputs.
|
||||
(,(lambda (package)
|
||||
|
|
11
tests/ui.scm
11
tests/ui.scm
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013-2017, 2019-2020, 2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2022 Taiju HIGASHI <higashi@taiju.info>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
|
@ -294,6 +294,15 @@ (define guile-2.0.9
|
|||
(>0 (package-relevance libb2
|
||||
(map rx '("crypto" "library")))))))
|
||||
|
||||
(test-assert "package-relevance and upstream name"
|
||||
;; https://issues.guix.gnu.org/58136
|
||||
(let ((ggplot2 (specification->package "r-ggplot2"))
|
||||
(ggstance (specification->package "r-ggstance"))
|
||||
(rx (make-regexp "ggplot2" regexp/icase)))
|
||||
(> (package-relevance ggplot2 (list rx))
|
||||
(package-relevance ggstance (list rx))
|
||||
0)))
|
||||
|
||||
(define (make-empty-file directory file)
|
||||
;; Create FILE in DIRECTORY.
|
||||
(close-port (open-output-file (in-vicinity directory file))))
|
||||
|
|
Loading…
Reference in a new issue