--- Begin Message ---
Subject: |
[PATCH] guix package: Remove trailing slash from profile path. |
Date: |
Fri, 17 Feb 2017 11:00:54 +0100 |
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 #\/)))
+ (_ #f))
opts)
(() (list %current-profile))
(lst lst)))
--
2.11.1
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#25772: [PATCH] guix package: Remove trailing slash from profile path. |
Date: |
Thu, 20 Jul 2017 15:31:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Hello!
Alex Kost <address@hidden> skribis:
> Ricardo Wurmus (2017-02-17 23:38 +0100) wrote:
>
> [...]
>>> (let* ((profiles (match (filter-map (match-lambda
>>> - (('profile . p) p)
>>> - (_ #f))
>>> + (('profile . p)
>>> + (readlink (string-trim-right p
>>> #\/)))
>>> + (_ #f))
>>> opts)
>>> (() (list %current-profile))
>>> (lst lst)))
>>
>> I don’t know if this is the right place for this change or if this
>> should be further upstream.
>
> I think it is not the right place: you modify only 'process-query'
> procedure, but there is also 'process-actions', so the following command
> will still fail:
>
> guix package -p /tmp/test-profile/ -i hello
>
> while the following succeeds:
>
> guix package -p /tmp/test-profile -i hello
>
> So I would rather modify 'canonicalize-profile' procedure in that
> module. I think it will be a general solution for --profile option.
Indeed. I pushed something along these lines as
edbe07cd67d6050d94fe8ac1af15ab15e857b61d, and a related fix as
561f4e450078a06c707d3dcda2cf0e7d6eb5ebae.
Thanks!
Ludo’.
--- End Message ---