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.
parent
c08e9599ef
commit
3e3f888dd3
|
@ -378,7 +378,10 @@ respectively."
|
||||||
"warning: failed to parse ~a~%"
|
"warning: failed to parse ~a~%"
|
||||||
(hackage-cabal-url hackage-name))
|
(hackage-cabal-url hackage-name))
|
||||||
#f)
|
#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)))
|
(let ((url (hackage-uri hackage-name version)))
|
||||||
(upstream-source
|
(upstream-source
|
||||||
(package (package-name package))
|
(package (package-name package))
|
||||||
|
|
Reference in New Issue