summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-03-12 17:07:04 +0100
committerLudovic Courtès <ludo@gnu.org>2019-03-12 23:51:32 +0100
commitc9c51ac39aae7a4a49c8125916740f340fdfd4f7 (patch)
tree7bff7e1fb5b0f182b944bf9c7ad48a96234a9a43 /guix/packages.scm
parent29e76f07223bed1520a19d273ada5fc48fba141d (diff)
downloadguix-patches-c9c51ac39aae7a4a49c8125916740f340fdfd4f7.tar
guix-patches-c9c51ac39aae7a4a49c8125916740f340fdfd4f7.tar.gz
Revert "packages: 'package-input-rewriting' can take a promise."
This reverts commit 7d2be1277b44de9d0528d9d3015443b40cb3b104, which turned out to be unhelpful for the problem at hand: https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00486.html
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 8515bb7c6f..f191327718 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -855,27 +855,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