gnu-maintenance: Use 'http-fetch/cached' by default.
This speeds up operations like 'guix lint -c gnu-description'. * guix/gnu-maintenance.scm (official-gnu-packages): Add 'fetch' parameter and honor it. Default to 'http-fetch/cached'.
This commit is contained in:
parent
739ab68bac
commit
9aec35d265
|
@ -116,8 +116,10 @@
|
||||||
(doc-urls gnu-package-doc-urls) ; list of strings
|
(doc-urls gnu-package-doc-urls) ; list of strings
|
||||||
(download-url gnu-package-download-url))
|
(download-url gnu-package-download-url))
|
||||||
|
|
||||||
(define (official-gnu-packages)
|
(define* (official-gnu-packages
|
||||||
"Return a list of records, which are GNU packages."
|
#:optional (fetch http-fetch/cached))
|
||||||
|
"Return a list of records, which are GNU packages. Use FETCH,
|
||||||
|
to fetch the list of GNU packages over HTTP."
|
||||||
(define (read-records port)
|
(define (read-records port)
|
||||||
;; Return a list of alists. Each alist contains fields of a GNU
|
;; Return a list of alists. Each alist contains fields of a GNU
|
||||||
;; package.
|
;; package.
|
||||||
|
@ -129,8 +131,7 @@
|
||||||
(cons alist result)))))
|
(cons alist result)))))
|
||||||
|
|
||||||
(define official-description
|
(define official-description
|
||||||
(let ((db (read-records (http-fetch %package-description-url
|
(let ((db (read-records (fetch %package-description-url #:text? #t))))
|
||||||
#:text? #t))))
|
|
||||||
(lambda (name)
|
(lambda (name)
|
||||||
;; Return the description found upstream for package NAME, or #f.
|
;; Return the description found upstream for package NAME, or #f.
|
||||||
(and=> (find (lambda (alist)
|
(and=> (find (lambda (alist)
|
||||||
|
@ -160,7 +161,7 @@
|
||||||
"doc-url"
|
"doc-url"
|
||||||
"download-url")
|
"download-url")
|
||||||
'("doc-url" "language"))))
|
'("doc-url" "language"))))
|
||||||
(read-records (http-fetch %package-list-url #:text? #t))))
|
(read-records (fetch %package-list-url #:text? #t))))
|
||||||
|
|
||||||
(define (find-packages regexp)
|
(define (find-packages regexp)
|
||||||
"Find GNU packages which satisfy REGEXP."
|
"Find GNU packages which satisfy REGEXP."
|
||||||
|
|
Loading…
Reference in New Issue