[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25772: [PATCH] guix package: Remove trailing slash from profile path
From: |
Alex Kost |
Subject: |
bug#25772: [PATCH] guix package: Remove trailing slash from profile path. |
Date: |
Sun, 19 Feb 2017 14:52:34 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Ricardo Wurmus (2017-02-17 11:00 +0100) wrote:
> Fixes: <http://bugs.gnu.org/25762>.
>
> * guix/scripts/package.scm (process-query): Remove trailing slash from profile
> argument and resolve links.
> ---
> guix/scripts/package.scm | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
> index 9e5b7f3c7..544a1730e 100644
> --- a/guix/scripts/package.scm
> +++ b/guix/scripts/package.scm
> @@ -6,6 +6,7 @@
> ;;; Copyright © 2016 Roel Janssen <address@hidden>
> ;;; Copyright © 2016 Benz Schenk <address@hidden>
> ;;; Copyright © 2016 Chris Marusich <address@hidden>
> +;;; Copyright © 2017 Ricardo Wurmus <address@hidden>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -663,8 +664,9 @@ doesn't need it."
> "Process any query specified by OPTS. Return #t when a query was actually
> processed, #f otherwise."
> (let* ((profiles (match (filter-map (match-lambda
> - (('profile . p) p)
> - (_ #f))
> + (('profile . p)
> + (readlink (string-trim-right p
> #\/)))
I think 'readlink' shouldn't be called here (why did you add it btw?).
For example, I have "~/.guix-profiles/build/build" profile and with this
readlink call, it will be expanded to "~/.guix-profiles/build/build-9-link".
So with this patch, both
guix package -p ~/.guix-profiles/build/build -l and
guix package -p ~/.guix-profiles/build/build/ -l
will fail, because under the hood there will be the following call:
(display-generation "/home/al/.guix-profiles/build/build-9-link" 9)
which fails. Instead it should be (as it is now):
(display-generation "/home/al/.guix-profiles/build/build" 9)
So I think just (string-trim-right p #\/) is enough.
--
Alex