summaryrefslogtreecommitdiff
path: root/gnu/packages.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-02-20 17:19:00 +0100
committerMarius Bakke <mbakke@fastmail.com>2019-02-20 17:19:00 +0100
commit901236474a9523595c0bdefd5ac22366e78b9e61 (patch)
tree667efe648d584b0c960b0da0d577b8a71b6b941c /gnu/packages.scm
parent63d4ef52ebad4157817d56ccbe974da8fff81929 (diff)
parent64766d5cafd5cf19189ed274eb7e29ef784f90de (diff)
downloadpatches-901236474a9523595c0bdefd5ac22366e78b9e61.tar
patches-901236474a9523595c0bdefd5ac22366e78b9e61.tar.gz
Merge branch 'staging' into core-updates
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r--gnu/packages.scm53
1 files changed, 30 insertions, 23 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 9cd57fc704..e484d9754f 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -375,34 +375,41 @@ reducing the memory footprint."
(define cache-file
(string-append directory %package-cache-file))
- (define (expand-cache module symbol variable result)
+ (define (expand-cache module symbol variable result+seen)
(match (false-if-exception (variable-ref variable))
((? package? package)
- (if (hidden-package? package)
- result
- (cons `#(,(package-name package)
- ,(package-version package)
- ,(module-name module)
- ,symbol
- ,(package-outputs package)
- ,(->bool (member (%current-system)
- (package-supported-systems package)))
- ,(->bool (package-superseded package))
- ,@(let ((loc (package-location package)))
- (if loc
- `(,(location-file loc)
- ,(location-line loc)
- ,(location-column loc))
- '(#f #f #f))))
- result)))
+ (match result+seen
+ ((result . seen)
+ (if (or (vhash-assq package seen)
+ (hidden-package? package))
+ (cons result seen)
+ (cons (cons `#(,(package-name package)
+ ,(package-version package)
+ ,(module-name module)
+ ,symbol
+ ,(package-outputs package)
+ ,(->bool
+ (member (%current-system)
+ (package-supported-systems package)))
+ ,(->bool (package-superseded package))
+ ,@(let ((loc (package-location package)))
+ (if loc
+ `(,(location-file loc)
+ ,(location-line loc)
+ ,(location-column loc))
+ '(#f #f #f))))
+ result)
+ (vhash-consq package #t seen))))))
(_
- result)))
+ result+seen)))
(define exp
- (fold-module-public-variables* expand-cache '()
- (all-modules (%package-module-path)
- #:warn
- warn-about-load-error)))
+ (first
+ (fold-module-public-variables* expand-cache
+ (cons '() vlist-null)
+ (all-modules (%package-module-path)
+ #:warn
+ warn-about-load-error))))
(mkdir-p (dirname cache-file))
(call-with-output-file cache-file