From f37f2b83fa95c1fe2bf01c4b8072cfc23d4c67ec Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Apr 2017 15:19:15 +0200 Subject: 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. --- doc/guix.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc') 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. -- cgit v1.2.3