summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJOULAUD François <Francois.JOULAUD@radiofrance.com>2021-01-18 08:26:02 +0000
committerLudovic Courtès <ludo@gnu.org>2021-01-19 17:45:38 +0100
commit4d79f072cc7b502fc25486d514c9200ba684a596 (patch)
tree57d1ec4803e1381ac79bf916d9ad87307a4da821 /tests
parentf97ee7741883cc69be90947c7e699bd8435f065f (diff)
environment: Fix '--root' option with relative file name.
The path normalization of `--root` option of `guix environment` was buggy as it appended full argument after normalized directory. This patch fixes it. * guix/scripts/environment.scm (register-gc-root): Fix gc-root path normalization. * tests/guix-environment.sh: Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-environment.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index f8be48f0c0..afadcbe195 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -121,6 +121,12 @@ guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \
test `readlink "$gcroot"` = "$expected"
rm "$gcroot"
+# Try '-r' with a relative file name.
+(cd "$tmpdir"; mkdir "gc-root";
+ guix environment --bootstrap -r "gc-root/r" --ad-hoc guile-bootstrap \
+ -- guile -c 1;
+ rm "gc-root/r"; rmdir "gc-root")
+
# Same with an absolute file name.
guix environment --bootstrap -r "$PWD/$gcroot" --ad-hoc guile-bootstrap \
-- guile -c 1