From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AE1IH/CqOWOeeQEAbAwnHQ (envelope-from ) for ; Sun, 02 Oct 2022 17:14:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QMRjH/CqOWPOgAEA9RJhRA (envelope-from ) for ; Sun, 02 Oct 2022 17:14:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 36C2A2DE5 for ; Sun, 2 Oct 2022 17:14:56 +0200 (CEST) Received: from localhost ([::1]:58760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of0gB-0002aA-Dq for larch@yhetil.org; Sun, 02 Oct 2022 11:14:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1of07S-0006hr-8C for bug-guix@gnu.org; Sun, 02 Oct 2022 10:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48717) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1of07R-0007tq-VV for bug-guix@gnu.org; Sun, 02 Oct 2022 10:39:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1of07R-00029q-RO for bug-guix@gnu.org; Sun, 02 Oct 2022 10:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#58250: [PATCH 2/2] import: print: Use file-name->module-name. Resent-From: itd Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 02 Oct 2022 14:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58250 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 58250@debbugs.gnu.org Received: via spool by 58250-submit@debbugs.gnu.org id=B58250.16647214978241 (code B ref 58250); Sun, 02 Oct 2022 14:39:01 +0000 Received: (at 58250) by debbugs.gnu.org; 2 Oct 2022 14:38:17 +0000 Received: from localhost ([127.0.0.1]:47795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of06j-00028r-D6 for submit@debbugs.gnu.org; Sun, 02 Oct 2022 10:38:17 -0400 Received: from mailout3.rbg.tum.de ([131.159.0.8]:57359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1of06i-00028f-0E for 58250@debbugs.gnu.org; Sun, 02 Oct 2022 10:38:16 -0400 Received: from mailrelay1.rbg.tum.de (mailrelay1.in.tum.de [131.159.254.14]) by mailout3.rbg.tum.de (Postfix) with ESMTPS id 9E9F9100129 for <58250@debbugs.gnu.org>; Sun, 2 Oct 2022 16:38:10 +0200 (CEST) Received: by mailrelay1.rbg.tum.de (Postfix, from userid 112) id 9BD181A8; Sun, 2 Oct 2022 16:38:10 +0200 (CEST) Received: from mailrelay1.rbg.tum.de (localhost [127.0.0.1]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id 628D41A1 for <58250@debbugs.gnu.org>; Sun, 2 Oct 2022 16:38:10 +0200 (CEST) Received: from mail.net.in.tum.de (mail.net.in.tum.de [IPv6:2001:4ca0:2001:14:216:3eff:fe52:ed14]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id 60F66CD for <58250@debbugs.gnu.org>; Sun, 2 Oct 2022 16:38:10 +0200 (CEST) Received: from amnesix.net.in.tum.de (amnesix.net.in.tum.de [131.159.20.238]) by mail.net.in.tum.de (Postfix) with ESMTP id 488B828D0804; Sun, 2 Oct 2022 16:38:10 +0200 (CEST) From: itd In-Reply-To: References: <871qrqfgiq.fsf@localhost> Date: Sun, 02 Oct 2022 16:38:09 +0200 Message-ID: <87v8p2e1f2.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 02 Oct 2022 11:14:47 -0400 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664723696; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=oa6JSoqZu4fSXFLlU9HG95khOXJ5+vMEyvQIf2J+VDs=; b=InIOQlh5ftn5jNLpm6gjIUK/1Lu5BWIAZ8mKGzGkyiUDsiaD7TzYU2YC2ivFg8yrk4L3jH 7ig6aPVCTW2wajGkg68jRGBTC0qTkfE4zfsjd+bPWqvc+jjbsfucv1NIIy66DqqHNBxzSF aEgX/axJaM63dv6PMKbIMcYqZGE5LJIAHJy+BTj17K/vIIgHEA2MR17LxuVcxcycPb+x4c F1fFWk2gImNNN3cW1WnR0+DjE1YEtCkSxnZmfQUbByUXcBEjuI4xyQyloHhlXjo5r7f4zm c8m53Aty35A63jGJAwenodTT1sE/XFH43U2/XnAg9BdKFWuXfUqkpzJ4Rt6HDA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664723696; a=rsa-sha256; cv=none; b=Iu54Jirs9EhAYNMT/a6l6clH5/FVSTh25SgIMW7CprJgPkCZN5JD9gQ/Km2mDhZj6MqrB+ dansQx050rpsJ0UFjab7s2clb8RX+S5Uq09HaE8fcts44Fs0SfLkYMjBOtfuLVTQOIHkiN VcHCXs9McCtUcC9TC16lucRz4uFHVOiVRsoNo1OjMItb6jkT6mMoNWN02b6Vp7dhpe6ug3 oBRRsfkJPQUsUkHF8YoZNMiEus78mcysqZOarVMxsCh3KwDtFsIbI5AD8W5iQtyIAH3TYt 4hJebQBOEmLjMJb6vv9UrTVbQkfr1ndGAwQoB6WcRttzO8IG4LjWlb+z0uNskA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=tum.de (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.76 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=tum.de (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 36C2A2DE5 X-Spam-Score: 3.76 X-Migadu-Scanner: scn1.migadu.com X-TUID: w3p8T1XtesWO * 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