Received: (at submit) by debbugs.gnu.org; 10 Jan 2024 00:05:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 09 19:05:05 2024
Received: from localhost ([127.0.0.1]:41335 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rNM5g-0001RT-MY
for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 19:05:05 -0500
Received: from lists.gnu.org ([2001:470:142::17]:43076)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <felix.lechner@HIDDEN>) id 1rNM5e-0001Qt-Fc
for submit <at> debbugs.gnu.org; Tue, 09 Jan 2024 19:05:03 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <felix.lechner@HIDDEN>)
id 1rNM5Q-00083M-1J
for guix-patches@HIDDEN; Tue, 09 Jan 2024 19:04:48 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
(Exim 4.90_1) (envelope-from <felix.lechner@HIDDEN>)
id 1rNM5C-0000AG-AR
for guix-patches@HIDDEN; Tue, 09 Jan 2024 19:04:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=KBhZBAyuKvhRJ8R
5nBkZxug658JZAHSH0JdYyao9c2s=; h=date:subject:cc:to:from;
d=lease-up.com; b=ouI7feLYyhlfWUWoLufnQSQeL9UQcPdSV/weuIq3zTd7RGAeUIav
DjSuTbGMfvFLzjNtR90fN3EYv6A0ioI5KWDXrT41TWqGXLUZmO99TfPVhUrFmk/zSbnF1I
Mqm006NxlqttHnWuC5cvHt+vKxgaGbOiS4WTGB+KZ0gmGzUr4=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 57a0c7df
(TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO);
Wed, 10 Jan 2024 00:04:29 +0000 (UTC)
Received: from localhost (localhost [local])
by localhost (OpenSMTPD) with ESMTPA id f760a4fd;
Wed, 10 Jan 2024 00:04:28 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] guix: import(cpan): Complete even when modules do not exist
on CPAN.
Date: Tue, 9 Jan 2024 16:04:13 -0800
Message-ID: <444f876473d530a973b2ca2309e593069ceb08c1.1704845053.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=208.82.101.137;
envelope-from=felix.lechner@HIDDEN; helo=sail-ipv4.us-core.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248,
SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01,
UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.2 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: Allows the following import command to complete: guix import
cpan SOAP::Lite As a side note, the Perl module was needed to deploy Debbugs
on GNU Guix.
Content analysis details: (1.2 points, 10.0 required)
pts rule name description
---- ---------------------- --------------------------------------------------
0.9 SPF_FAIL SPF: sender does not match SPF record (fail)
[SPF failed: Please see http://www.openspf.org/Why?s=mfrom;
id=felix.lechner%40us-core.com; ip=2001%3A470%3A142%3A%3A17;
r=debbugs.gnu.org]
-0.0 SPF_HELO_PASS SPF: HELO matches SPF record
0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
mail domains are different
-0.0 T_SCC_BODY_TEXT_LINE No description available.
0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay
lines
X-Debbugs-Envelope-To: submit
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.2 (/)
Allows the following import command to complete:
guix import cpan SOAP::Lite
As a side note, the Perl module was needed to deploy Debbugs on GNU Guix.
Change-Id: Ic184c3e95e18ec8385b181ab8c34035cbb0aa0f5
---
guix/import/cpan.scm | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index b87736eef6..de557bc024 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -138,11 +138,16 @@ (define (module->dist-name module)
"Return the base distribution module for a given module. E.g. the 'ok'
module is distributed with 'Test::Simple', so (module->dist-name \"ok\") would
return \"Test-Simple\""
- (assoc-ref (json-fetch (string-append
- (%metacpan-base-url) "/module/"
- module
- "?fields=distribution"))
- "distribution"))
+ (let* ((url (string-append
+ (%metacpan-base-url) "/module/" module
+ "?fields=distribution"))
+ (json-alist (json-fetch url))
+ (dist-name (assoc-ref json-alist "distribution")))
+ (if (not dist-name)
+ (format (current-error-port)
+ "Cannot determine distribution name for module ~s from ~s~%"
+ module url))
+ dist-name))
(define (package->upstream-name package)
"Return the CPAN name of PACKAGE."
@@ -249,10 +254,14 @@ (define (cran-dependency->upstream-input dependency)
#f))))
(and type
(not (core-module? module)) ;expensive call!
- (upstream-input
- (name (module->dist-name module))
- (downstream-name (cpan-name->downstream-name name))
- (type type)))))))
+ (let* ((cpan-name (module->dist-name module))
+ (downstream-name (if cpan-name
+ (cpan-name->downstream-name cpan-name)
+ (format #f "Module ~a not found on CPAN" module))))
+ (upstream-input
+ (name cpan-name)
+ (downstream-name downstream-name)
+ (type type))))))))
(define (cpan-module-inputs release)
"Return the list of <upstream-input> for dependencies of RELEASE, a
base-commit: b9fae146d6cc4a6968a8eb18beef29aa1414a31e
--
2.41.0
Felix Lechner <felix.lechner@HIDDEN>:guix-patches@HIDDEN.
Full text available.guix-patches@HIDDEN:bug#68356; Package guix-patches.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.