summaryrefslogtreecommitdiff
path: root/guix/scripts/package.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-15 22:59:50 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-15 22:59:50 +0200
commitb2ba65c8970a1371244015cc918257f9972454ec (patch)
treedaedb2ddf5794350002c461b15ec802d3e54a774 /guix/scripts/package.scm
parent3c1d9799b82fa6104d6b56073131a8aa43336ce9 (diff)
downloadgnu-guix-b2ba65c8970a1371244015cc918257f9972454ec.tar
gnu-guix-b2ba65c8970a1371244015cc918257f9972454ec.tar.gz
guix package: '--search' matches against package names.
* guix/scripts/package.scm (find-packages-by-description): Return packages whose name matches RX.
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r--guix/scripts/package.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 5c7c165cbb..0b9e0c4f6f 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -325,8 +325,8 @@ DURATION-RELATION with the current time."
(else #f)))
(define (find-packages-by-description rx)
- "Search in SYNOPSIS and DESCRIPTION using RX. Return a list of
-matching packages."
+ "Return the list of packages whose name, synopsis, or description matches
+RX."
(define (same-location? p1 p2)
;; Compare locations of two packages.
(equal? (package-location p1) (package-location p2)))
@@ -337,7 +337,8 @@ matching packages."
(define matches?
(cut regexp-exec rx <>))
- (if (or (and=> (package-synopsis package)
+ (if (or (matches? (gettext (package-name package)))
+ (and=> (package-synopsis package)
(compose matches? gettext))
(and=> (package-description package)
(compose matches? gettext)))