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

Previous Next

Package: guix;

Reported by: itd <itd <at> net.in.tum.de>

Date: Sun, 2 Oct 2022 14:27:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: itd <itd <at> net.in.tum.de>
To: 58250 <at> debbugs.gnu.org
Subject: bug#58250: [PATCH 2/2] import: print: Use file-name->module-name.
Date: Sun, 02 Oct 2022 16:38:09 +0200
* 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))))
 
   ;; Return the first candidate variable name that is bound to VAL.
   (define (variable-name val mod)
-- 
2.37.3





This bug report was last modified 2 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.