From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id kGpNNR3J82ZVHAAAqHPOHw:P1 (envelope-from ) for ; Wed, 25 Sep 2024 08:26:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id kGpNNR3J82ZVHAAAqHPOHw (envelope-from ) for ; Wed, 25 Sep 2024 10:26:05 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=rcB6TH6t; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=kFw20mgC; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727252765; h=from:from:sender:sender:reply-to: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=iJVeFyn9Nw7+EcXxvjuAGiCPRxPkavef58GRgl9pFzo=; b=c0Eo/3HRGAfqolhOc4ZguSmSn7ZPGdZHKZhGvQPcLwMd3NyOnVaOkmOaqfgU5ipCEJuCVR l5M5BmyuVOE46mGsFEPTYTqZ4t9NOVbMpGyJ635Ar+Pk3hJMVt9t3CC97RADBn5Di0WGAZ NlfR1Oy2rJ4WPOrmiITI71ezdE3xSsO0pjbARxDhMuPkXuLXkExzrpUIrrv369xENGHWDA jJfYA+yYl2Rfe6xy30o+esoXI00y1e5FFBEZEkvf6JaFtg1qd3roBSeLlM4A+/tgfKy3aL CT8aVXFLX6GVJ019NsO4Ysrb2rn5Ya0GKazkxYI57lgiwAXIGnD2StomUANckA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=rcB6TH6t; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=kFw20mgC; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727252765; a=rsa-sha256; cv=none; b=p+iNKrs/4Yuh+Td6dzLoXT9/miNe0kaoYEjeqn66WFpfjMJHcC5PSQaHIocqCV3KLWeO4M cLirw78SzkNIKhHZ4qPzG+VzptN2d+amcCFRVSEz3z5Z/g3DPTYbAcWYM2QacS8OX0jWO0 2zAESJLvg/9R/1/pOca485Opqd/5dBMpe1cqLmfyZ/K4hJas2amgX0KvAxEKCQX6TiRkxv nxfaQvIdInGBGFZ319iMl/op2ua/WiHoA9Tobg5vfOlyhzX2qJgwM9WPL+2O9UFT/s0qMV 4eot35JfHXzYnx4JvJ3ZsdA8D/5bP9BbAYHI2lxl2rrZjGMsbn0GzZHmszm8WA== 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 7B4773D2D for ; Wed, 25 Sep 2024 10:26:04 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stNLL-0004qq-Vh; Wed, 25 Sep 2024 04:25:52 -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 1stNL7-0004pW-Tt for guix-patches@gnu.org; Wed, 25 Sep 2024 04:25:37 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stNL7-0007TV-Kd for guix-patches@gnu.org; Wed, 25 Sep 2024 04:25:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=iJVeFyn9Nw7+EcXxvjuAGiCPRxPkavef58GRgl9pFzo=; b=rcB6TH6tabe5HxsBVMY2qjQcGWfPyzCLXC5Yi/uVFT07/eVBlpMfgL3R4ssll648dVyiPXIpEoid2xOzoxLVgg7p0i5cNEb1pPL4xvNrnNlz5o1RK/1z+xt+sNP4noAUSkpRwipCiBMY7GxLUBkCVqhdNMiBjRjA62cet1mvC5fbBzQ6CN+o4gqnu0bTM71zPqurQfbFCFLSbUmMxiM/VQJFD4omx3P+r3+o8kmoDTbul1VAfA9MVkl8qXWxMKGtNT3KqYeYG5mDuA2AHmuJXIgiZgIP6sYedtsNDsw1+igchNljSfDCSw+eG8K/nT3u02dLoKc0M0JuoopTL9Mwew==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stNLW-0005UO-HV for guix-patches@gnu.org; Wed, 25 Sep 2024 04:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73458] [PATCH 2/2] build-system: mix: Fix decoding of package names with git versions. Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Sep 2024 08:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73458 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 73458@debbugs.gnu.org Cc: Giacomo Leidi Received: via spool by 73458-submit@debbugs.gnu.org id=B73458.172725272820486 (code B ref 73458); Wed, 25 Sep 2024 08:26:02 +0000 Received: (at 73458) by debbugs.gnu.org; 25 Sep 2024 08:25:28 +0000 Received: from localhost ([127.0.0.1]:46002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stNKx-0005KI-0v for submit@debbugs.gnu.org; Wed, 25 Sep 2024 04:25:27 -0400 Received: from confino.investici.org ([93.190.126.19]:36801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stNKv-0005K3-0S for 73458@debbugs.gnu.org; Wed, 25 Sep 2024 04:25:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1727252691; bh=iJVeFyn9Nw7+EcXxvjuAGiCPRxPkavef58GRgl9pFzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kFw20mgCo26mWf/z5fd77bC7Xx84u0B8aH9kN6c5ntR6yCwn+YyVY4//NLa6cCRcH Nb/NFkkut9dPlavh0nTufl0z5werPSl6aLQEYH7LBhczPnfyV1EkxYWqtFiJ6hstDc POx6Lq0kFP1J2RlQm+0yvwvJSNedcXLcPCPOiJRE= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4XD8sv36clz10ym; Wed, 25 Sep 2024 08:24:51 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4XD8sv2HwTz10yS; Wed, 25 Sep 2024 08:24:51 +0000 (UTC) Date: Wed, 25 Sep 2024 10:24:33 +0200 Message-ID: <573318832af8089d4b974598cc284d1a2b5b3cd9.1727252673.git.goodoldpaul@autistici.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <58afb3593e28f5f670b2be516a165b59e2665276.1727252673.git.goodoldpaul@autistici.org> References: <58afb3593e28f5f670b2be516a165b59e2665276.1727252673.git.goodoldpaul@autistici.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: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches From: Giacomo Leidi via Guix-patches via 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 X-Migadu-Spam-Score: -4.51 X-Spam-Score: -4.51 X-Migadu-Queue-Id: 7B4773D2D X-Migadu-Scanner: mx10.migadu.com X-TUID: uHn7g70QfhsL Fixes * guix/build/mix-build-system.scm (%git-version-rx): New variable, (package-name->elixir-name): use %git-version-rx to discriminate git versions from regular ones. Change-Id: Icc6dc56c3db62dfbc17c7c71354a7a7e3d2e5b2a --- guix/build/mix-build-system.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/guix/build/mix-build-system.scm b/guix/build/mix-build-system.scm index 41f6061444..7250785914 100644 --- a/guix/build/mix-build-system.scm +++ b/guix/build/mix-build-system.scm @@ -40,6 +40,9 @@ (define-module (guix build mix-build-system) ;; minor version number of the Elixir used in the build. (define %elixir-version (make-parameter "X.Y")) +(define %git-version-rx + (make-regexp "^(.*)-[0-9]+(\\.[0-9]+)?(\\.[0-9]+)?-[0-9]+\\..+$")) + (define (elixir-relative-libdir version) "Return the relative path inside a package namespace in the store where all libraries for a specified Elixir VERSION are installed." @@ -141,10 +144,12 @@ (define* (remove-mix-dirs . _) (define (package-name->elixir-name name+ver) "Convert the Guix package NAME-VER to the corresponding Elixir name-version -format. Example: elixir-a-pkg-1.2.3 -> a_pkg" +format. Example: elixir-a-pkg-1.2.3 -> a_pkg or elixir-a-pkg-0.0.0-0.e51e36e +-> a_pkg" + (define git-version? (regexp-exec %git-version-rx name+ver)) ((compose (cute string-join <> "_") - (cute drop-right <> 1) + (cute drop-right <> (if git-version? 2 1)) (cute string-split <> #\-)) (strip-prefix name+ver))) -- 2.46.0