diff mbox series

[bug#45953] environment: fix --root option with relative path

Message ID 20210118082300.phr55ee5chgwmptl@fjo-extia-HPdeb.example.avalenn.eu
State Accepted
Headers show
Series [bug#45953] environment: fix --root option with relative path | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

kasper.andersson--- via Guix-patches" via Jan. 18, 2021, 8:26 a.m. UTC
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(-)

Comments

Ludovic Courtès Jan. 19, 2021, 5:16 p.m. UTC | #1
Hi,

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

> 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:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=4d79f072cc7b502fc25486d514c9200ba684a596

Thanks,
Ludo’.
diff mbox series

Patch

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)