Hi Simon,
Simon Tournier <zimon.toutoune@gmail.com> writes:
Toggle quote (3 lines)
> Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.
nitpick: 'Reported-by:' is a Git trailing (message tag); it should
appear at the bottom of the commit message for Git tools to correctly
parse it.
Toggle quote (17 lines)
> * guix/packages.scm (package-field-location): Add package/inherit case.
> ---
> guix/packages.scm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/guix/packages.scm b/guix/packages.scm
> index ba98bb0fb484..821eddb72d5d 100644
> --- a/guix/packages.scm
> +++ b/guix/packages.scm
> @@ -761,7 +761,8 @@ (define (package-field-location package field)
> (lambda (port)
> (go-to-location port line column)
> (match (read port)
> - (('package inits ...)
> + ((or ('package inits ...)
> + ('package/inherit inits ...))
I tested it in 'guix repl' for zxing-cpp-1.2, and something didn't go
well:
Toggle snippet (22 lines)
scheme@(guix-user)> ,use (guix packages)
scheme@(guix-user)> ,use (gnu packages aidc)
scheme@(guix-user)> zxing-cpp-1.2
$1 = #<package zxing-cpp@1.2.0 gnu/packages/aidc.scm:76 7f4b56450d10>
scheme@(guix-user)> (package-field-location $1 'version)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure assoc: Wrong type argument: zxing-cpp
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guix-user) [1]> ,bt
In ice-9/boot-9.scm:
1747:15 4 (with-exception-handler #<procedure 7f4b58de8480 at ice-9/boot-9.scm:1831:7 (exn)> _ # _ # …)
In ice-9/ports.scm:
433:17 3 (call-with-input-file _ _ #:binary _ #:encoding _ #:guess-encoding _)
In guix/packages.scm:
766:32 2 (_ _)
In srfi/srfi-1.scm:
241:2 1 (assoc _ _ _)
In ice-9/boot-9.scm:
1685:16 0 (raise-exception _ #:continuable? _)
Toggle snippet (12 lines)
modified guix/packages.scm
@@ -762,7 +762,7 @@ (define (package-field-location package field)
(go-to-location port line column)
(match (read port)
((or ('package inits ...)
- ('package/inherit parent inits ...))
+ ('package/inherit _ inits ...))
(let ((field (assoc field inits)))
(match field
((_ value)
And it now works; yay! Will install shortly.
--
Thanks,
Maxim