aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-04-05 15:19:15 +0200
committerLudovic Courtès <ludo@gnu.org>2017-04-05 22:45:41 +0200
commitf37f2b83fa95c1fe2bf01c4b8072cfc23d4c67ec (patch)
treebed6bac6a29ee4575fdbf34604bd380f0d5c2ff7 /doc
parent79f912c7106131f4179c727583d33500271361cd (diff)
downloadgnu-guix-f37f2b83fa95c1fe2bf01c4b8072cfc23d4c67ec.tar
gnu-guix-f37f2b83fa95c1fe2bf01c4b8072cfc23d4c67ec.tar.gz
packages: Add 'package-mapping' and base 'package-input-rewriting' on it.
* guix/packages.scm (package-mapping): New procedure. (package-input-rewriting): Rewrite in terms of 'package-mapping'. * tests/packages.scm ("package-mapping"): New test. * doc/guix.texi (Defining Packages): Document it.
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index aa779e38e2..b2498d039e 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2946,6 +2946,16 @@ with @var{libressl}. Then we use it to define a @dfn{variant} of the
This is exactly what the @option{--with-input} command-line option does
(@pxref{Package Transformation Options, @option{--with-input}}).
+A more generic procedure to rewrite a package dependency graph is
+@code{package-mapping}: it supports arbitrary changes to nodes in the
+graph.
+
+@deffn {Scheme Procedure} package-mapping @var{proc} [@var{cut?}]
+Return a procedure that, given a package, applies @var{proc} to all the packages
+depended on and returns the resulting package. The procedure stops recursion
+when @var{cut?} returns true for a given package.
+@end deffn
+
@menu
* package Reference :: The package data type.
* origin Reference:: The origin data type.