[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: guix package: '-s' displays different packages that have the same
01/02: guix package: '-s' displays different packages that have the same location.
Fri, 20 Mar 2015 21:07:39 +0000
civodul pushed a commit to branch master
in repository guix.
Author: Ludovic CourtÃ¨s <address@hidden>
Date: Fri Mar 20 21:48:31 2015 +0100
guix package: '-s' displays different packages that have the same location.
Before that, 'guix package -s foobarbaz' would display only one package
when several match but they have the same location (which is common when
The original rationale was given at
it was arguably misguided because it led to "real" packages being
Reported by TomÃ¡Å¡ Äech <address@hidden>.
* guix/scripts/package.scm (find-packages-by-description)[same-location?]:
Remove call to 'delete-duplicates'.
guix/scripts/package.scm | 36 +++++++++++++++---------------------
1 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index a24c657..41db191 100644
@@ -240,28 +240,22 @@ DURATION-RELATION with the current time."
(define (find-packages-by-description rx)
"Return the list of packages whose name, synopsis, or description matches
- (define (same-location? p1 p2)
- ;; Compare locations of two packages.
- (equal? (package-location p1) (package-location p2)))
- (fold-packages (lambda (package result)
- (define matches?
- (cut regexp-exec rx <>))
- (if (or (matches? (package-name package))
- (and=> (package-synopsis package)
- (compose matches? P_))
- (and=> (package-description package)
- (compose matches? P_)))
- (cons package result)
- (lambda (p1 p2)
- (string<? (package-name p1)
- (package-name p2))))
+ (fold-packages (lambda (package result)
+ (define matches?
+ (cut regexp-exec rx <>))
+ (if (or (matches? (package-name package))
+ (and=> (package-synopsis package)
+ (compose matches? P_))
+ (and=> (package-description package)
+ (compose matches? P_)))
+ (cons package result)
+ (lambda (p1 p2)
+ (string<? (package-name p1)
+ (package-name p2)))))
(define-syntax-rule (leave-on-EPIPE exp ...)
"Run EXP... in a context when EPIPE errors are caught and lead to 'exit'