[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/05: import: hackage: Allow version at the beginning of cabal file.
From: |
guix-commits |
Subject: |
01/05: import: hackage: Allow version at the beginning of cabal file. |
Date: |
Sat, 31 Dec 2022 09:49:15 -0500 (EST) |
lbraun pushed a commit to branch wip-haskell
in repository guix.
commit 19a05b48795a0a3ce7431c241aa5dac1c7e8551b
Author: Lars-Dominik Braun <lars@6xq.net>
AuthorDate: Sat Jun 11 11:02:52 2022 +0200
import: hackage: Allow version at the beginning of cabal file.
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 3c2cd75db4..be855afcfb 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -377,7 +377,10 @@ respectively."
"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))