From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id gKu/LViF9GZaGwEAqHPOHw:P1 (envelope-from ) for ; Wed, 25 Sep 2024 21:49:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gKu/LViF9GZaGwEAqHPOHw (envelope-from ) for ; Wed, 25 Sep 2024 23:49:12 +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=pX1QHWbA; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=qhwOTlBW; 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=1727300952; 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=QWV9RRmEqDEYQknD9GgeQFY2VjPwzrxJZFvD4ZRJroA=; b=YqF+Fu1kJG82ivmY4xuEvmFTyQTh43BSaRQvFREhqdR/ofY35plYgGnxoXc9rsq1aYiLNP eBiIybnzuZYrLFR7JXRLNpxcVOXD+XsAMZ6aHhJWRTYqllKNbOfkfII92xJdswKV2Nd3Oh V2uovLwt0gIJhdJa2R3BnqG+HQykSUkJyfvc40U/JTUWtxC7I/1Cdz6gxh9ppFnf6sjNaO 1KkY6i4breDI7ZMMofUCMogmDOd8p2qaZFJlg5G8wKZbWcs1bmUnWYiJGuGo3L/hCJUoUk lLzCsAcR+xEeghRYHxIjM2lmOn+0Ygi51W5Y0jnhgqLeQSNWlc1Zs8VKwvvyNg== 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=pX1QHWbA; dkim=fail ("headers rsa verify failed") header.d=autistici.org header.s=stigmate header.b=qhwOTlBW; 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=1727300952; a=rsa-sha256; cv=none; b=C3vr9KMbaWvXM9rZ1L4k5XV7aKuQwD7sUqf7WtJD7ne31bt6+m+GgIUrY5tU0zaM45U16c cygCTRTcnM/9gMzOXTF9mpzSsaarbv0jZxfV5EafaoPhBy6aBxEkAZpBwD+oOcR6QjiUy/ R9JoWilE4YyrInH9VL+0Ik4Gcb3xJAcBqMHpj5smryUsNnR8383tPGyZSZTDtapVRw94Yd lGRhqGFg5YCeaXAq9h0LXIjPRbo+zskBuxkWeFAfzxU1K9WE7Ec18I4k5hP+TIQ3Yga8Dk 3itMO9av2XN3veneuYkHUwCEdm0ojnlYDncT0sxaT7RHEP4lK+LNGFED8mka7A== 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 9792272D28 for ; Wed, 25 Sep 2024 23:49:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stZsK-0001Gy-A0; Wed, 25 Sep 2024 17:48:44 -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 1stZsD-0001Fh-8e for guix-patches@gnu.org; Wed, 25 Sep 2024 17:48:38 -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 1stZsD-0004i1-3B for guix-patches@gnu.org; Wed, 25 Sep 2024 17:48: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=QWV9RRmEqDEYQknD9GgeQFY2VjPwzrxJZFvD4ZRJroA=; b=pX1QHWbAkJ3E7SCkdUVfukhcc+4bvkDsx6bOVgC/ZDxbxvqweWs9z2GVJpXIgWAeXj9sxnwbMJ45l2D8pwm7DpALiBfpVC5pDhfVNNNvjxx7FO2e6nvB6egqdtb+jbVj6RlZENIbagYgyP/Sde0mRCcjvaP9fcK1xiHUCt+GcDjvSgAYD7UrmyDty+vz1yep5DQNzFEPUAuo4RarxMLqfP2MPgXggZVAv1UtYwJMsaVseclNGh3ZWPgteQ06OUaxVpbwZ5GJcpgfkRzF2X2MS3C6Ng/xPOmaDkn2nHyEGZgZi/sJALR9Zdms0hLzIkklqniV1sp6Z6OYdDQjS8cmGA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stZsd-0004q9-6e for guix-patches@gnu.org; Wed, 25 Sep 2024 17:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73458] [PATCH v2 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 21:49:03 +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.172730092718546 (code B ref 73458); Wed, 25 Sep 2024 21:49:03 +0000 Received: (at 73458) by debbugs.gnu.org; 25 Sep 2024 21:48:47 +0000 Received: from localhost ([127.0.0.1]:57996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stZsN-0004p3-6p for submit@debbugs.gnu.org; Wed, 25 Sep 2024 17:48:47 -0400 Received: from confino.investici.org ([93.190.126.19]:32825) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stZsI-0004om-CH for 73458@debbugs.gnu.org; Wed, 25 Sep 2024 17:48:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1727300384; bh=QWV9RRmEqDEYQknD9GgeQFY2VjPwzrxJZFvD4ZRJroA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhwOTlBWO5qBq61mskVg4P0siFU3HBil50IglV8CdBsLJIir0wpRZE59og2SG9PGZ hc3zDLKmIaZ8otrxFo4+jQ934SQdK7iZ719nAK5qktiuJ2j+kLl/BCTEN6UdN1nz+E ghqn8sgBYsFe5yL6/m87n/M2ZeYjk01uGdJQ6PW8= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4XDVW44fhwz114x; Wed, 25 Sep 2024 21:39:44 +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 4XDVW43tqxz114j; Wed, 25 Sep 2024 21:39:44 +0000 (UTC) Date: Wed, 25 Sep 2024 23:39:18 +0200 Message-ID: <7d8ec46ff87e1c6d83f614404ea4be30c182109c.1727300358.git.goodoldpaul@autistici.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: 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-Queue-Id: 9792272D28 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -6.62 X-Migadu-Spam-Score: -6.62 X-TUID: mj3F5BnucjUc * 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. Fixes Change-Id: Icc6dc56c3db62dfbc17c7c71354a7a7e3d2e5b2a Change-Id: I99ad5e36680928e50c0cba5beb85f34c7bfa12df --- 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 73af575b10..6b7541cf56 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-libdir path #:optional (version (%elixir-version))) "Return the path where all libraries under PATH for a specified Elixir VERSION are installed." @@ -133,10 +136,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