diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-04-28 22:20:36 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-05-10 14:53:57 +0200 |
commit | e00ade3fb81f89cd7c030f998ccd3e07ef2628f0 (patch) | |
tree | 13978a5a0a893f1faf1476f9f42d33511a7c72e1 /guix/build/union.scm | |
parent | dac1c97d131d297134fa878ac240d9ec0127044b (diff) | |
download | gnu-guix-e00ade3fb81f89cd7c030f998ccd3e07ef2628f0.tar gnu-guix-e00ade3fb81f89cd7c030f998ccd3e07ef2628f0.tar.gz |
profiles: Optionally use relative file names for symlink targets.
* guix/build/union.scm (symlink-relative): New procedure.
* guix/build/profiles.scm: Re-export it.
(build-profile): Add #:symlink and pass it to 'union-build'.
* guix/profiles.scm (profile-derivation): Add #:relative-symlinks?.
Pass #:symlink to 'build-profile'.
* tests/profiles.scm ("profile-derivation relative symlinks, one entry")
("profile-derivation relative symlinks, two entries"): New tests.
Diffstat (limited to 'guix/build/union.scm')
-rw-r--r-- | guix/build/union.scm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/build/union.scm b/guix/build/union.scm index 82d6199d9e..24b366af45 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -29,7 +29,8 @@ warn-about-collision - relative-file-name)) + relative-file-name + symlink-relative)) ;;; Commentary: ;;; @@ -213,4 +214,10 @@ Note that this is from a purely lexical standpoint; conversely, \"..\" is (finish))))))) file)) +(define (symlink-relative old new) + "Assuming both OLD and NEW are absolute file names, make NEW a symlink to +OLD, but using a relative file name." + (symlink (relative-file-name (dirname new) old) + new)) + ;;; union.scm ends here |