From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yGzSDPdmtWCzPAAAgWs5BA (envelope-from ) for ; Tue, 01 Jun 2021 00:45:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EKRNCPdmtWDhfAAAB5/wlQ (envelope-from ) for ; Mon, 31 May 2021 22:45:11 +0000 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 E1B1F27957 for ; Tue, 1 Jun 2021 00:45:10 +0200 (CEST) Received: from localhost ([::1]:50404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnqej-0006IG-Tx for larch@yhetil.org; Mon, 31 May 2021 18:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnqef-0006Ea-13 for guix-patches@gnu.org; Mon, 31 May 2021 18:45:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnqee-0007UW-Oj for guix-patches@gnu.org; Mon, 31 May 2021 18:45:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnqee-000414-NM for guix-patches@gnu.org; Mon, 31 May 2021 18:45:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48766] [PATCH 06/14] guix: maven: Look in local packages when searching for package version. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 31 May 2021 22:45:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48766@debbugs.gnu.org Received: via spool by 48766-submit@debbugs.gnu.org id=B48766.162250108915344 (code B ref 48766); Mon, 31 May 2021 22:45:04 +0000 Received: (at 48766) by debbugs.gnu.org; 31 May 2021 22:44:49 +0000 Received: from localhost ([127.0.0.1]:35174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnqeO-0003zK-J1 for submit@debbugs.gnu.org; Mon, 31 May 2021 18:44:48 -0400 Received: from lepiller.eu ([89.234.186.109]:38958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnqeI-0003xm-Pc for 48766@debbugs.gnu.org; Mon, 31 May 2021 18:44:43 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id fe675ec0 for <48766@debbugs.gnu.org>; Mon, 31 May 2021 22:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=OL9jAiIKyAKCxJSuSThYHbMwS 3bmFBKimqChJnSDkeM=; b=azXM5861rWUzAR49UfNL3zp3a6NCF/vk6iIcWwp6K 2NynYScikoLqcY3wEqd67Z+5AWC33kmyv8eGEnifyt7tJ8ekBd14W5VGfLosXVmg 1uoOOkMhJkUm9s5uzQUks1j+XENnkNzUQBYx07LPHMR1+Qbwikp26WC509dkjOn4 zhRg4UmE8JNoebWwiUsXrAmpR0cjIN4tVtz4rknXIoXOCHUeeW1TpW5WNrju9gCe OFm7EixcA3IqOkJx6puC9rTJQYEBBmPSxJOLmVrRon8ts8x5ysJ76OKZi0tgtqiW 45cFf/QLe/mgxlfwqbzbFuCwEwvHxhyERk2iesjJG4a6Q== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id cf83f1c1 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <48766@debbugs.gnu.org>; Mon, 31 May 2021 22:44:38 +0000 (UTC) From: Julien Lepiller Date: Tue, 1 Jun 2021 00:44:19 +0200 Message-Id: <20210531224427.13300-6-julien@lepiller.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531224427.13300-1-julien@lepiller.eu> References: <20210601004100.69baa2d0@tachikoma.lepiller.eu> <20210531224427.13300-1-julien@lepiller.eu> 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622501111; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=8Xz6En9R9XAFoRFE/Jg7zPTodwitSD3tYYymwzWsh5Y=; b=f7jb22MfxDJNztcOSUDEVlCqlOtMdsV7lAk6opHaaWuDtYeurdnDYwHr54WKfcG9uaq1oF wu5dlZaw5enPHEhF2WX75pB1WQ8Hv5OYAc/4BR6uHQc/u9nyk4etRcaxgDggBu+yrjfQ8O KJD9KBbceZJlqlzf2P6fuDyFoVz4dpeTGNbTGgTnBdlRmZekYHV3UKYiEUBbB/WkRlSBLa 0nQeFN1WYhvQoGZVrMOWyOgRaG9jO6g7rf8p+7ICIkFpV9PS9jNBt10q2Gd0WKRr5yLSP+ K3VPwBrDpJrObVxd/HMhQOKxhvJfNiqm9VdXcvZffs0HVjQ7GiuoOrc2oF+98w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622501111; a=rsa-sha256; cv=none; b=BFfbwu84J0jpbyu3RSEtwQmVxoNhmnM2hRxDg79Qs4sJNrWh5gSVK4aA0Gmn17dSv7z4VF /dGzK78/kuSNetsnUU+Mx0Z9lwXP1I7LV9qwAL2LZ/GpGvqSp6h9JSMlFsxwk/5ZeyfS0O rDs7EuHoPFdV1UVGw/ZWiG4qSvBZby7k+9dRWWuxZNOyeujn0piOJ7xVcPepjp2sKtI55J cR7VDd3znbROEbrDjs986Og3e80k407NiwRWMKNVFj5sNm/y/pH8XFDNDW2CTYE8071xcr IidOSDpXLwKqigXNYEtKErA4i7dsw2Pj0vgQR9EgygrzWySTFJlM5KF3JXtxTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=azXM5861; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=azXM5861; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: E1B1F27957 X-Spam-Score: 3.67 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6upFKJly/OnE * guix/build/maven/pom.scm (fix-pom-dependencies): Also look at local packages when looking for a package version. --- guix/build/maven/pom.scm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/guix/build/maven/pom.scm b/guix/build/maven/pom.scm index ffb4515179..9c0669c7cd 100644 --- a/guix/build/maven/pom.scm +++ b/guix/build/maven/pom.scm @@ -481,7 +481,7 @@ Returns nothing, but overrides the @var{pom-file} as a side-effect." (cons `(http://maven.apache.org/POM/4.0.0:version ,version) dep))) dep))) - (define* (find-version inputs group artifact #:optional optional?) + (define (find-packaged-version inputs group artifact) (let* ((directory (string-append "lib/m2/" (group->dir group) "/" artifact)) (java-inputs (filter @@ -493,13 +493,19 @@ Returns nothing, but overrides the @var{pom-file} as a side-effect." (versions (append-map ls java-inputs)) (versions (sort versions version>?))) (if (null? versions) - (if optional? #f - (begin - (format (current-error-port) "maven: ~a:~a is missing from inputs~%" - group artifact) - (throw 'no-such-input group artifact))) - (car versions)))) + (car versions)))) + + (define* (find-version inputs group artifact #:optional optional?) + (let ((packaged-version (find-packaged-version inputs group artifact)) + (local-version (assoc-ref (assoc-ref local-packages group) artifact))) + (or local-version packaged-version + (if optional? + #f + (begin + (format (current-error-port) "maven: ~a:~a is missing from inputs~%" + group artifact) + (throw 'no-such-input group artifact)))))) (let ((tmpfile (string-append pom-file ".tmp"))) (with-output-to-file pom-file -- 2.31.1