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 RXiLLhpntWCQPQAAgWs5BA (envelope-from ) for ; Tue, 01 Jun 2021 00:45:46 +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 UIRNKRpntWDefAAAB5/wlQ (envelope-from ) for ; Mon, 31 May 2021 22:45:46 +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 30D8F279F1 for ; Tue, 1 Jun 2021 00:45:46 +0200 (CEST) Received: from localhost ([::1]:51498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnqfJ-000734-85 for larch@yhetil.org; Mon, 31 May 2021 18:45:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnqee-0006DZ-Fy for guix-patches@gnu.org; Mon, 31 May 2021 18:45:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnqee-0007U7-8A 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-00040s-5k for guix-patches@gnu.org; Mon, 31 May 2021 18:45:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48766] [PATCH 05/14] guix: maven: Support fixing modules. 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.162250108815337 (code B ref 48766); Mon, 31 May 2021 22:45:04 +0000 Received: (at 48766) by debbugs.gnu.org; 31 May 2021 22:44:48 +0000 Received: from localhost ([127.0.0.1]:35172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnqeO-0003zD-8J for submit@debbugs.gnu.org; Mon, 31 May 2021 18:44:48 -0400 Received: from lepiller.eu ([89.234.186.109]:38956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnqeI-0003xU-7g for 48766@debbugs.gnu.org; Mon, 31 May 2021 18:44:42 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 8a3cc6ef for <48766@debbugs.gnu.org>; Mon, 31 May 2021 22:44:38 +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=Apj/7mxqi0l88qNpqPTNLXM75 2wPyC5+tF3uIPw6J1c=; b=Ye6TCoTcS07Oecqj4KlU1Un79M4HlgStNuQ+hVa+9 e9W5Z1Lt0eFoToc/qrErOlCGnWuf49oWbUxRqsLEfCpGj1SAUl/HSHCTkMTP1Ndv ZasqnX/yI1d5seTKj2x+uCcEQjHDywkH/wuXgr7hFxPCQxbsrHml/IqZ8KnfLdLg mA6SiCSGr3LFf3zeygSzJiEGsnD4aR4GiSqhmGka+3Jx5DE/JjY32xmA2zu2kIGt ArJ0XVr9N0QSjmI20pDw0c38mI7NAj84PuhgjYhZ2SoRkT+Rhw1s2H84A+83+JH8 Pcywt1c70tfuLibtSANeDVWZycozqAd5q8/mDpTfNteBA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ea965aa7 (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:18 +0200 Message-Id: <20210531224427.13300-5-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=1622501146; 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=e5K6k1ORbrA6Me9LJsGjNTaMW4G6v9KVBPtLkyndc3Q=; b=n96/2U9aqRtbTUMU0J2ou4LJ0k4SpvPi9sMifzkX6L9AXjamoSA/qNYLBVGzjwfRa2fQ3e 5SEv1e0lQeQLsXOvBrjLXtf0NPYMldbLlodjqExF0K76ys43sj4rqwGqeOCnyv6B7WH2qA Nu/dsgK8q+6OOdzw63AXUtymznwwx3Afy6ONiYr8LNuUAGCAly/asah7A/vJJsXbPyJ/ai xkPteOOQeuWbmAfV0+L3drXhC03bkUYvz1uhYKPROUknHSKsK2rVXNN4/L6nquEaHsl2jY 01RrsoAKg5LbdhGI+UDdm2yTYsP6fhBM3Benz8X4KqEvrVulJFCwrR6+Dbn8dA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622501146; a=rsa-sha256; cv=none; b=RGz66L8enAUg8nyc3YYnnRz1hf0Gz3A2c9xcHNSeUf5j20iQ8BtYZQhx6CC6MoSCbFhiv1 HkQmHt6o8URO1WXnX7PFCoEL7a/ejTJZsXIN/J6KWm8H04DOP5IdoYiCHG6xtA1+K1efKx nV8ttHmdOKppSB8Tqk/2WVlhv/bPJpOfhWR1Nb+l0KsheSIRiDDrmqQ84NWb5XKindLddm /ct8LDuYY/NM+DnQ+8E03lGvfmHj3nyuf30XOWKKif0dIclrJ4dK0KddIlwV8wsekefq9g gEFEYPHf1+4VveAVo83H8I1KKVqWQvoNSRK79lNiThArwBcIPMfbYcG669Ry7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=Ye6TCoTc; 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-Spam-Score: 3.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=Ye6TCoTc; 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: 30D8F279F1 X-Spam-Score: 3.67 X-Migadu-Scanner: scn0.migadu.com X-TUID: eeujEx8DEpLl * guix/build/maven/pom.scm (fix-pom-dependencies): Support fixing modules that do not exist. * guix/build/maven-build-system.scm (fix-pom): Fix modules. --- guix/build/maven-build-system.scm | 1 + guix/build/maven/pom.scm | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/guix/build/maven-build-system.scm b/guix/build/maven-build-system.scm index 374fa2fdb8..b3d97c81ea 100644 --- a/guix/build/maven-build-system.scm +++ b/guix/build/maven-build-system.scm @@ -65,6 +65,7 @@ (format #t "fixing ~a~%" pom-file) (fix-pom-dependencies pom-file (map cdr inputs) #:with-plugins? #t #:with-build-dependencies? #t + #:with-modules? #t #:local-packages local-packages #:excludes excludes)) diff --git a/guix/build/maven/pom.scm b/guix/build/maven/pom.scm index 3a4ad7a216..ffb4515179 100644 --- a/guix/build/maven/pom.scm +++ b/guix/build/maven/pom.scm @@ -291,7 +291,8 @@ this repository contains." (define* (fix-pom-dependencies pom-file inputs #:key with-plugins? with-build-dependencies? - (excludes '()) (local-packages '())) + with-modules? (excludes '()) + (local-packages '())) "Open @var{pom-file}, and override its content, rewritting its dependencies to set their version to the latest version available in the @var{inputs}. @@ -339,8 +340,24 @@ Returns nothing, but overrides the @var{pom-file} as a side-effect." `((http://maven.apache.org/POM/4.0.0:build ,(fix-build build)) ,@(fix-pom rest)) (cons tag (fix-pom rest)))) + (('http://maven.apache.org/POM/4.0.0:modules modules ...) + (if with-modules? + `((http://maven.apache.org/POM/4.0.0:modules ,(fix-modules modules)) + ,@(fix-pom rest)) + (cons tag (fix-pom rest)))) (tag (cons tag (fix-pom rest))))))) + (define fix-modules + (match-lambda + ('() '()) + ((tag rest ...) + (match tag + (('http://maven.apache.org/POM/4.0.0:module module) + (if (file-exists? (string-append (dirname pom-file) "/" module "/pom.xml")) + `((http://maven.apache.org/POM/4.0.0:module ,module) ,@(fix-modules rest)) + (fix-modules rest))) + (tag (cons tag (fix-modules rest))))))) + (define fix-dep-management (match-lambda ('() '()) -- 2.31.1