gnu-maintenance: Replace 'find-packages' with 'find-package' (singular).

Fixes <http://bugs.gnu.org/23718>.
Reported by Efraim Flashner <efraim@flashner.co.il>.

* guix/gnu-maintenance.scm (find-packages): Remove.
(find-package): New procedure.
* guix/import/gnu.scm (gnu->guix-package): Use 'find-package' instead of
'find-packages' and adjust accordingly.
This commit is contained in:
Ludovic Courtès 2016-06-08 17:59:45 +02:00
parent ae76830857
commit dc794a7238
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 12 additions and 13 deletions

View File

@ -48,7 +48,7 @@
gnu-package-download-url gnu-package-download-url
official-gnu-packages official-gnu-packages
find-packages find-package
gnu-package? gnu-package?
release-file? release-file?
@ -155,13 +155,12 @@ to fetch the list of GNU packages over HTTP."
(close-port port) (close-port port)
lst))) lst)))
(define (find-packages regexp) (define (find-package name)
"Find GNU packages which satisfy REGEXP." "Find GNU package called NAME and return it. Return #f if it was not
(let ((name-rx (make-regexp regexp))) found."
(filter (lambda (package) (find (lambda (package)
(false-if-exception (string=? name (gnu-package-name package)))
(regexp-exec name-rx (gnu-package-name package)))) (official-gnu-packages)))
(official-gnu-packages))))
(define gnu-package? (define gnu-package?
(memoize (memoize

View File

@ -111,13 +111,13 @@ details.)"
(match (latest-release name) (match (latest-release name)
((? upstream-source? release) ((? upstream-source? release)
(let ((version (upstream-source-version release))) (let ((version (upstream-source-version release)))
(match (find-packages (regexp-quote name)) (match (find-package name)
((info . _) (#f
(gnu-package->sexp info release #:key-download key-download))
(()
(raise (condition (raise (condition
(&message (&message
(message "couldn't find meta-data for GNU package")))))))) (message "couldn't find meta-data for GNU package")))))
(info
(gnu-package->sexp info release #:key-download key-download)))))
(_ (_
(raise (condition (raise (condition
(&message (&message