mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gexp: Add 'file-union'.
* gnu/services.scm (file-union): Move to... * guix/gexp.scm (file-union): ... here. New procedure. * doc/guix.texi (G-Expressions): Document it.
This commit is contained in:
parent
7a51c78c6e
commit
dedb512f8f
3 changed files with 49 additions and 20 deletions
|
@ -97,7 +97,6 @@
|
|||
%activation-service
|
||||
etc-service
|
||||
|
||||
file-union ;XXX: for lack of a better place
|
||||
directory-union))
|
||||
|
||||
;;; Comment:
|
||||
|
@ -388,25 +387,6 @@ boot."
|
|||
(list (service-extension boot-service-type
|
||||
cleanup-gexp)))))
|
||||
|
||||
(define* (file-union name files) ;FIXME: Factorize.
|
||||
"Return a <computed-file> that builds a directory containing all of FILES.
|
||||
Each item in FILES must be a list where the first element is the file name to
|
||||
use in the new directory, and the second element is a gexp denoting the target
|
||||
file."
|
||||
(computed-file name
|
||||
#~(begin
|
||||
(mkdir #$output)
|
||||
(chdir #$output)
|
||||
#$@(map (match-lambda
|
||||
((target source)
|
||||
#~(begin
|
||||
;; Stat the source to abort early if it
|
||||
;; does not exist.
|
||||
(stat #$source)
|
||||
|
||||
(symlink #$source #$target))))
|
||||
files))))
|
||||
|
||||
(define (directory-union name things)
|
||||
"Return a directory that is the union of THINGS."
|
||||
(match things
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue