From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CO0iOBO7dGQPgwEASxT56A (envelope-from ) for ; Mon, 29 May 2023 16:47:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UJdYOBO7dGTEGwEA9RJhRA (envelope-from ) for ; Mon, 29 May 2023 16:47:47 +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 A651930DC7 for ; Mon, 29 May 2023 16:47:47 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3e9c-0002Ej-37; Mon, 29 May 2023 10:47:24 -0400 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 ) id 1q3e9L-00023p-KV for guix-patches@gnu.org; Mon, 29 May 2023 10:47:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3e9L-00034X-CQ for guix-patches@gnu.org; Mon, 29 May 2023 10:47:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3e9L-0001QA-94 for guix-patches@gnu.org; Mon, 29 May 2023 10:47:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63571] [PATCH v2 14/19] import: cpan: Updater provides input list. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 29 May 2023 14:47:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63571 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63571@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63571-submit@debbugs.gnu.org id=B63571.16853716155310 (code B ref 63571); Mon, 29 May 2023 14:47:07 +0000 Received: (at 63571) by debbugs.gnu.org; 29 May 2023 14:46:55 +0000 Received: from localhost ([127.0.0.1]:58789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3e99-0001NT-3s for submit@debbugs.gnu.org; Mon, 29 May 2023 10:46:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3e8G-0001JG-9D for 63571@debbugs.gnu.org; Mon, 29 May 2023 10:46:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e8B-0002fr-2K; Mon, 29 May 2023 10:45:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=AJIRNvPuRGp7n+ouE86Sv0Ifra7WWFR8mKH0dXxOYa8=; b=XFfOEecD3EWBftHvE06x Kq+j957qapBmBXFWvktdK6D9l5E5J6VHIYLTtOimZ3luhgS5yNDC4/u9IyrRHClL9DSYxKorPWk9q qtCs+Fz4GuZMD5eaEoFtdzgt5X3R9jkMv70f1pcZJ7gIz6zrPO93jwiP0Q1txtZixdZ8uK8bYFQtz 3GI7Iu4lntkxLBDxNn+8dqlXd8KN+BdNuXlbi5rR519qPJgkyuHQu9ASXhyHwccFptfR/sp3aQyp+ z1v6WlhL5+d7vOUYGGxK0ZLNuhmhHwp9tM48eh8XCO6ib1t48HDngUsmA/UNFdFmGgOeNuFIdVoLV 7XzoX5b6zAc5JA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3e8A-00044B-L4; Mon, 29 May 2023 10:45:54 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 29 May 2023 16:45:25 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: <87y1l7fb9j.fsf@gnu.org> References: <87y1l7fb9j.fsf@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685371667; a=rsa-sha256; cv=none; b=VonA2/ghKJrCj9yY+N0NmoZU7SuTAzT5row+n02KsSNwzhdhTLRiTFqRrZEPn2SeAUnlWF yXuUoyWr4VzsNlpdPqM3VnuQdlsJVYnCjeAH70dN0+vZ/b2GUjz2w8sDl337jJGGVYCjD3 cPwsRIUGh8ohJZaE7cxpeGxmGyKBfmJHFeBh9M5pCc4+hv7pG/3JPO1+7BDbELbj53dIKH q4Y5lh0PuuRFQHDugNX3ylim/GKIdXuPOcWQQtm86IV5HdbLOiDs4TMPZbcomnsH8apmMQ CtK5BTIwMjApoFlwRBLNldaMLHuBa9jKDBe9anvEGKufOWiACtLCZkDTJxhcRA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=XFfOEecD; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1685371667; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: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:dkim-signature; bh=AJIRNvPuRGp7n+ouE86Sv0Ifra7WWFR8mKH0dXxOYa8=; b=WE+7j6xx09bW2UVWmFCMvM8U/txzL37NSAOMmey2vLL2LfaKdsRM/99NOtNeH+ClwOzIFg L+x0WsvMIFHZvOHm/xjBB+8UwiRVspaCQfvCRDcVTIkQ7iGW0wj1DtqMRhAXuClAkh8dj4 gvZ5zANynnRLKD+bV292+TAXUIl5qpMUaB66l8F66Xq4NKDq+/Ef2uceRuhJtnpfAATSsi HPVQu4v580QkXsRLoM0eHCjy/RLY+HcayXoL7J9sGQ/PYqDU74rz3z7JtWz1vlFGaiiLgh /Yo0Bv3/ZmPe5+Cxj7yLX+5q9p1qykJzO0ZlQw8+4LQZKupZOqr0PYYc9Jn1ww== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=XFfOEecD; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.55 X-Spam-Score: -2.55 X-Migadu-Queue-Id: A651930DC7 X-TUID: /ZdLUWTQ1DZO * guix/import/cpan.scm (latest-release): Add 'inputs' field. * tests/cpan.scm ("package-latest-release"): New test. --- guix/import/cpan.scm | 3 ++- tests/cpan.scm | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index b6587d6821..b87736eef6 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -354,7 +354,8 @@ (define* (latest-release package #:key (version #f)) (upstream-source (package (package-name package)) (version version) - (urls (list url))))))) + (urls (list url)) + (inputs (cpan-module-inputs release))))))) (define %cpan-updater (upstream-updater diff --git a/tests/cpan.scm b/tests/cpan.scm index c9dd6d36de..5fcce85d8d 100644 --- a/tests/cpan.scm +++ b/tests/cpan.scm @@ -21,7 +21,10 @@ (define-module (test-cpan) #:use-module (guix import cpan) #:use-module (guix base32) + #:use-module (guix upstream) + #:use-module ((guix download) #:select (url-fetch)) #:use-module (gcrypt hash) + #:use-module (guix tests) #:use-module (guix tests http) #:use-module ((guix store) #:select (%graft?)) #:use-module (srfi srfi-64) @@ -92,6 +95,30 @@ (define test-source (x (pk 'fail x #f)))))) +(test-equal "package-latest-release" + (list '("http://example.com/Foo-Bar-0.1.tar.gz") + #f + (list (upstream-input + (name "Test-Script") + (downstream-name "perl-test-script") + (type 'propagated)))) + (with-http-server `((200 ,test-json) + (200 ,test-source) + (200 "{ \"distribution\" : \"Test-Script\" }")) + (define source + (parameterize ((%metacpan-base-url (%local-url))) + (package-latest-release + (dummy-package "perl-test-script" + (version "0.0.0") + (source (dummy-origin + (method url-fetch) + (uri "mirror://cpan/Foo-Bar-0.0.0.tgz")))) + (list %cpan-updater)))) + + (list (upstream-source-urls source) + (upstream-source-signature-urls source) + (upstream-source-inputs source)))) + (test-equal "metacpan-url->mirror-url, http" "mirror://cpan/authors/id/T/TE/TEST/Foo-Bar-0.1.tar.gz" (metacpan-url->mirror-url -- 2.40.1