summaryrefslogtreecommitdiff
path: root/guix/scripts/environment.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-18 16:57:56 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-19 00:11:15 +0100
commit840f38ba37af1d09eb1e896a6350d6ab7f6532d0 (patch)
tree2439b051b3b081f26e26ca368ed16642f57c9b56 /guix/scripts/environment.scm
parent67fee545cc0090cf9db7bc61fb74d30dadbd9973 (diff)
guix environment, build: Allow absolute file names with '--root'.
Reported by Chris Webber. * guix/scripts/build.scm (register-root): If ROOT is absolute, keep it as is. * guix/scripts/environment.scm (register-gc-root): Likewise. * tests/guix-environment.sh (expected): Add test.
Diffstat (limited to 'guix/scripts/environment.scm')
-rw-r--r--guix/scripts/environment.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 1d3be6a84f..a08367d1b1 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -531,8 +531,10 @@ message if any test fails."
(define (register-gc-root target root)
"Make ROOT an indirect root to TARGET. This is procedure is idempotent."
- (let* ((root (string-append (canonicalize-path (dirname root))
- "/" root)))
+ (let* ((root (if (string-prefix? "/" root)
+ root
+ (string-append (canonicalize-path (dirname root))
+ "/" root))))
(catch 'system-error
(lambda ()
(symlink target root)