bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58250: guix import json: GUIX_PACKAGE_PATH -- no code for module


From: Ludovic Courtès
Subject: bug#58250: guix import json: GUIX_PACKAGE_PATH -- no code for module
Date: Fri, 23 Dec 2022 14:50:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

itd <itd@net.in.tum.de> skribis:

> * guix/import/print.scm (package->code)[package-module-name]: Use
> file-name->module-name to build the package module name.
> ---
> This patch updates the JSON importer to use (guix modules)'s
> file-name->module-name to determine the module name.
>
>  guix/import/print.scm | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/guix/import/print.scm b/guix/import/print.scm
> index 2f54adbd8c..04e6b0a7b1 100644
> --- a/guix/import/print.scm
> +++ b/guix/import/print.scm
> @@ -21,6 +21,7 @@ (define-module (guix import print)
>    #:use-module (guix base32)
>    #:use-module (guix utils)
>    #:use-module (guix licenses)
> +  #:use-module (guix modules)
>    #:use-module (guix packages)
>    #:use-module (guix search-paths)
>    #:use-module (guix build-system)
> @@ -45,10 +46,7 @@ (define (package->code package)
>  when evaluated."
>    ;; The module in which the package PKG is defined
>    (define (package-module-name pkg)
> -    (map string->symbol
> -         (string-split (string-drop-right
> -                        (location-file (package-location pkg)) 4)
> -                       #\/)))
> +    (file-name->module-name (location-file (package-location pkg))))

LGTM!

Ludo'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]