[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
25/29: website: packages: 'all-packages' memoizes its result.
From: |
Ludovic Courtès |
Subject: |
25/29: website: packages: 'all-packages' memoizes its result. |
Date: |
Wed, 6 Dec 2017 09:24:27 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix-artwork.
commit 422b0d70e0d96953f0dbe8c04d7d3129e7a45763
Author: Ludovic Courtès <address@hidden>
Date: Wed Dec 6 14:19:07 2017 +0100
website: packages: 'all-packages' memoizes its result.
* website/apps/packages/data.scm (%package-list): New variable.
(all-packages): Use it.
---
website/apps/packages/data.scm | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/website/apps/packages/data.scm b/website/apps/packages/data.scm
index 424701a..148ec3d 100644
--- a/website/apps/packages/data.scm
+++ b/website/apps/packages/data.scm
@@ -34,23 +34,27 @@
"N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"))
+(define %package-list
+ (delay
+ ;; Note: Dismiss packages found in $GUIX_PACKAGE_PATH.
+ (let ((packages
+ (sort (parameterize ((%package-module-path (last-pair
+
(%package-module-path))))
+ (fold-packages (lambda (package lst)
+ (cons (or (package-replacement package)
+ package)
+ lst))
+ '()))
+ (lambda (p1 p2)
+ (string<? (package-name p1)
+ (package-name p2))))))
+ (cond ((null? packages) '())
+ ((getenv "GUIX_WEB_SITE_LOCAL") (list-head packages 300))
+ (else packages)))))
+
(define (all-packages)
"Return the list of all Guix package objects, sorted by name.
If GUIX_WEB_SITE_LOCAL=yes, return only 300 packages for
testing the website."
- ;; Note: Dismiss packages found in $GUIX_PACKAGE_PATH.
- (let ((packages
- (sort (parameterize ((%package-module-path (last-pair
- (%package-module-path))))
- (fold-packages (lambda (package lst)
- (cons (or (package-replacement package)
- package)
- lst))
- '()))
- (lambda (p1 p2)
- (string<? (package-name p1)
- (package-name p2))))))
- (cond ((null? packages) '())
- ((getenv "GUIX_WEB_SITE_LOCAL") (list-head packages 300))
- (else packages))))
+ (force %package-list))
- 13/29: website: packages: Correctly compute supported systems., (continued)
- 13/29: website: packages: Correctly compute supported systems., Ludovic Courtès, 2017/12/06
- 10/29: website: Use actual GuixSD screenshots., Ludovic Courtès, 2017/12/06
- 17/29: website: base: Change http to https in 'graphics'., Ludovic Courtès, 2017/12/06
- 19/29: website: base: Change URLs in 'data' from http to https., Ludovic Courtès, 2017/12/06
- 06/29: website: packages: Interpret synopsis/description Texinfo., Ludovic Courtès, 2017/12/06
- 21/29: website: packages: Gracefully deal with empty package descriptions., Ludovic Courtès, 2017/12/06
- 24/29: website: packages: Remove links to package issues., Ludovic Courtès, 2017/12/06
- 18/29: website: base: Change some http to https., Ludovic Courtès, 2017/12/06
- 23/29: website: Hard-code file:// URL root when GUIX_WEB_SITE_LOCAL., Ludovic Courtès, 2017/12/06
- 20/29: website: Change http to https in URLs., Ludovic Courtès, 2017/12/06
- 25/29: website: packages: 'all-packages' memoizes its result.,
Ludovic Courtès <=
- 28/29: website: Insert surrounding spaces when flattening markup., Ludovic Courtès, 2017/12/06
- 29/29: website: Add pseudo-post about GPCE., Ludovic Courtès, 2017/12/06
- 14/29: website: packages: Add a newline between packages., Ludovic Courtès, 2017/12/06
- 09/29: website: packages: Implement patch links., Ludovic Courtès, 2017/12/06
- 16/29: website: base: Change http to https in some URLs on 'contribute'., Ludovic Courtès, 2017/12/06
- 27/29: website: contact: Tweak., Ludovic Courtès, 2017/12/06
- 22/29: website: packages: /packages shows at most 30 packages., Ludovic Courtès, 2017/12/06
- 26/29: website: Unify and rationalize tags for blog posts., Ludovic Courtès, 2017/12/06