[PATCH] environment: fix --root option with relative path

  • Done
  • quality assurance status badge
Details
2 participants
  • JOULAUD François
  • Ludovic Courtès
Owner
unassigned
Submitted by
JOULAUD François
Severity
normal
J
J
JOULAUD François wrote on 18 Jan 2021 09:26
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
20210118082300.phr55ee5chgwmptl@fjo-extia-HPdeb.example.avalenn.eu
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: fix gc-root path normalization

Signed-off-by: Francois Joulaud <francois.joulaud@radiofrance.com>
---
guix/scripts/environment.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index fbc202c658..f4d12f89bf 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -675,7 +675,7 @@ message if any test fails."
(let* ((root (if (string-prefix? "/" root)
root
(string-append (canonicalize-path (dirname root))
- "/" root))))
+ "/" (basename root)))))
(catch 'system-error
(lambda ()
(symlink target root)
--
2.28.0
L
L
Ludovic Courtès wrote on 19 Jan 2021 18:16
(name . JOULAUD François)(address . Francois.JOULAUD@radiofrance.com)(address . 45953-done@debbugs.gnu.org)
87mtx4hmnu.fsf@gnu.org
Hi,

JOULAUD François <Francois.JOULAUD@radiofrance.com> skribis:

Toggle quote (6 lines)
> 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: fix gc-root path normalization

Good catch! I added a test, tweaked the commit log, and pushed:


Thanks,
Ludo’.
Closed
?