diff options
author | Marius Bakke <mbakke@fastmail.com> | 2019-02-20 17:01:39 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2019-02-20 17:01:39 +0100 |
commit | 2c76e19df4b0b4aa0171f1edd9f240f7b6ba5b84 (patch) | |
tree | c2e7a7f27dd9c7e704f2e78655328c903a6934d1 /gnu/packages.scm | |
parent | e6a668ec7303a71f87e4c9354b1458e555058c63 (diff) | |
parent | 78b2eb1ad3dcf05c25e0ee4980c97aa52de03a2d (diff) | |
download | patches-2c76e19df4b0b4aa0171f1edd9f240f7b6ba5b84.tar patches-2c76e19df4b0b4aa0171f1edd9f240f7b6ba5b84.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages.scm')
-rw-r--r-- | gnu/packages.scm | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm index a1814205f9..7b17e70c53 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -371,34 +371,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 |