summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-03-14 16:30:19 +0100
committerMarius Bakke <mbakke@fastmail.com>2019-03-14 16:30:19 +0100
commit19008a22d18e772062952034c58a15ed341df3b5 (patch)
tree3a7fb9b4abe5cbac3f7edd5d5c76abd993fad255 /guix/packages.scm
parent520ae432d446010ed6a5233c8abfda88a945926c (diff)
parentc958c31caefb20c32cf89caea7d4668d7021a92b (diff)
Merge branch 'staging' into core-updates
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm16
1 files changed, 4 insertions, 12 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index e5e568efab..1893539aab 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -857,27 +857,19 @@ when CUT? returns true for a given package."
#:optional (rewrite-name identity))
"Return a procedure that, when passed a package, replaces its direct and
indirect dependencies (but not its implicit inputs) according to REPLACEMENTS.
-REPLACEMENTS is a list of package pairs or a promise thereof; the first
-element of each pair is the package to replace, and the second one is the
-replacement.
+REPLACEMENTS is a list of package pairs; the first element of each pair is the
+package to replace, and the second one is the replacement.
Optionally, REWRITE-NAME is a one-argument procedure that takes the name of a
package and returns its new name after rewrite."
(define (rewrite p)
- (match (assq-ref (if (promise? replacements)
- (force replacements)
- replacements)
- p)
+ (match (assq-ref replacements p)
(#f (package
(inherit p)
(name (rewrite-name (package-name p)))))
(new new)))
- (package-mapping rewrite
- (lambda (package)
- (assq package (if (promise? replacements)
- (force replacements)
- replacements)))))
+ (package-mapping rewrite (cut assq <> replacements)))
(define-syntax-rule (package/inherit p overrides ...)
"Like (package (inherit P) OVERRIDES ...), except that the same