aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-10-17 13:04:12 +0200
committerLudovic Courtès <ludo@gnu.org>2015-10-17 14:42:07 +0200
commit9aec35d265a8f37d8bfe47d5b2baa701c8f03009 (patch)
tree41c10852c71491875f2b237f009c39dcb5af009e
parent739ab68bac4c5b15fee34d5938e3d7eee4735627 (diff)
downloadguix-9aec35d265a8f37d8bfe47d5b2baa701c8f03009.tar
guix-9aec35d265a8f37d8bfe47d5b2baa701c8f03009.tar.gz
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'.
-rw-r--r--guix/gnu-maintenance.scm11
1 files changed, 6 insertions, 5 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index ac83df40a3..920aae2173 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -116,8 +116,10 @@
(doc-urls gnu-package-doc-urls) ; list of strings
(download-url gnu-package-download-url))
-(define (official-gnu-packages)
- "Return a list of records, which are GNU packages."
+(define* (official-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)
;; Return a list of alists. Each alist contains fields of a GNU
;; package.
@@ -129,8 +131,7 @@
(cons alist result)))))
(define official-description
- (let ((db (read-records (http-fetch %package-description-url
- #:text? #t))))
+ (let ((db (read-records (fetch %package-description-url #:text? #t))))
(lambda (name)
;; Return the description found upstream for package NAME, or #f.
(and=> (find (lambda (alist)
@@ -160,7 +161,7 @@
"doc-url"
"download-url")
'("doc-url" "language"))))
- (read-records (http-fetch %package-list-url #:text? #t))))
+ (read-records (fetch %package-list-url #:text? #t))))
(define (find-packages regexp)
"Find GNU packages which satisfy REGEXP."