From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sEDkNIFp52MqugAAbAwnHQ (envelope-from ) for ; Sat, 11 Feb 2023 11:10:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qJT4M4Fp52MEHQAAG6o9tA (envelope-from ) for ; Sat, 11 Feb 2023 11:10:09 +0100 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 A31138EE7 for ; Sat, 11 Feb 2023 11:10:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQmop-0004sj-4C; Sat, 11 Feb 2023 05:09:19 -0500 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 1pQmoY-0004nF-T8 for guix-patches@gnu.org; Sat, 11 Feb 2023 05:09:02 -0500 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 1pQmoY-00008c-Kg for guix-patches@gnu.org; Sat, 11 Feb 2023 05:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQmoY-0004Br-HF for guix-patches@gnu.org; Sat, 11 Feb 2023 05:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61420] [PATCH 01/31] import: hackage: Allow version at the beginning of cabal file. References: In-Reply-To: Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 11 Feb 2023 10:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61420 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61420@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 61420-submit@debbugs.gnu.org id=B61420.167611012715851 (code B ref 61420); Sat, 11 Feb 2023 10:09:02 +0000 Received: (at 61420) by debbugs.gnu.org; 11 Feb 2023 10:08:47 +0000 Received: from localhost ([127.0.0.1]:38824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQmoH-000472-V0 for submit@debbugs.gnu.org; Sat, 11 Feb 2023 05:08:47 -0500 Received: from mout-p-102.mailbox.org ([80.241.56.152]:57618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQmoG-00046J-2M for 61420@debbugs.gnu.org; Sat, 11 Feb 2023 05:08:45 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4PDRBq1lH7z9sTS; Sat, 11 Feb 2023 11:08:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1676110115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=I6qko26I/iq5k8U8aBIo08sEGGTpyiqbw833ZyXWY+E=; b=FhdHdYCJT0ZbiGGO4Y6yH26UyRsD9qX9IvXgBBffsjDV/TV4X04bA0clYfDe1+2UFqU3cE 96ocgz0hUely/6TUdjhQS/N2JG46A/v3XYLNM33sk0ebCVvuxXFvwY4BFhS1Gf/oULMSmR UqEFruVnF5evbS0+sSUTIceTzK7DLEsNCSlCDL8Bj6ZH6yljpOrTE7oy2jQMwKRzv0W3Uw hzH+ciXAZIy8PjMZB5WzGFeqZsXZrAQTQ5ZsZCkoDLvyftWCIkmVAL7wkyxHoSNws4jX/j IkJO5aY6duesO3aeDy0qtgJzS+pkjHxd2wqx8CqnkCOuMBIzddwZqdtIMyaLEg== From: Lars-Dominik Braun Date: Sat, 11 Feb 2023 11:07:58 +0100 Message-Id: <20230211100825.47971-1-lars@6xq.net> 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=FhdHdYCJ; 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=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676110209; a=rsa-sha256; cv=none; b=pgIMl49qgQ+bUSYjn6SelAVzwI93ZB7f3sfleLaELT26OXthUsph0R/FUyHQVlsXcaOHyz clTUQ/XbK78BbAd+8eJ0CswvN6vGMK9fi1UmrfSGeTcR6LT3DdW07t8JX+7b7uRRyn/DSo gIRQnfh/w2e4YEPUuCRhKIGyRYm6Sbjzo9DZFoUjs9rOTubh76wN7jqcOT0+P1eN9mdMQZ I7+6hC+sWThbjX8Nx1IBEg/Fe4fx83OPpPa5iszxWi05caAbwiBBwnQPvap+U7gobhKiDJ 2kaWYBPvvTIN1nrIHOt1biXp5XPodxTk6tytPIi7FG5m8RELSY0k4+SS27JRTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676110209; 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=I6qko26I/iq5k8U8aBIo08sEGGTpyiqbw833ZyXWY+E=; b=pfI66xJ+mkbUE3kyMmRe9gR27BF0hKg7x2PpjvJPgprdvkrs+/y5Eo7zlYI8LpouX/EMvd e2sUJoHVr9NsXllYkPnIkUd0fevAwyVQqz5hJLzOru8s+dLieppNE+7G2lh7EAoyZs7ZxU CCnRGxiVKyV0sMVxBgqxcudXcXti96ZMbKK+mZLpEzzuqqXXbW05fVe+nb3jol5Reeo92a qDOVkSv1V8LIYHlwXoaiPpaNMuMpDPfAQ4nfIkKBGLu9xUOz3XHfNHblLCS1nW+MJ+OtaD gHw9Lyiy2kRU0L7wyUzRg4n0XLphIwRYR2zUgfKjQ4nt4MvGvxuu394ts4yiZg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=FhdHdYCJ; 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=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none) X-Migadu-Spam-Score: 7.00 X-Spam-Score: 7.00 X-Migadu-Queue-Id: A31138EE7 X-Migadu-Scanner: scn0.migadu.com X-TUID: HrB+csjTImss Fix a corner case, uncovered by the hedgehog package, which has the version field at the beginning of its cabal file. This causes a pattern match failure. * guix/import/hackage.scm (latest-release): Match version at beginning of expression too. --- guix/import/hackage.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 7bc2908405..e915aac58d 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -378,7 +378,10 @@ (define* (latest-release package #:key (version #f)) "warning: failed to parse ~a~%" (hackage-cabal-url hackage-name)) #f) - ((_ *** ("version" (version))) + ;; Cabal files have no particular order and while usually the version + ;; as somewhere in the middle it can also be at the beginning, + ;; requiring two pattern. + ((or (_ *** ("version" (version))) (("version" (version)) _ ...)) (let ((url (hackage-uri hackage-name version))) (upstream-source (package (package-name package)) -- 2.38.2