upstream: Reject bogus archive type guesses.
This would crash 'guix refresh -u' with source URLs ending in "…/v1.2.3". * guix/upstream.scm (package-update): Be stricter when determining ARCHIVE-TYPE.
This commit is contained in:
parent
68f1869cfc
commit
618f0582b4
|
@ -278,7 +278,13 @@ and 'interactive' (default)."
|
||||||
((archive-type)
|
((archive-type)
|
||||||
(match (and=> (package-source package) origin-uri)
|
(match (and=> (package-source package) origin-uri)
|
||||||
((? string? uri)
|
((? string? uri)
|
||||||
(file-extension (basename uri)))
|
(let ((type (file-extension (basename uri))))
|
||||||
|
;; Sometimes we have URLs such as
|
||||||
|
;; "https://github.com/…/tarball/v0.1", in which case
|
||||||
|
;; we must not consider "1" as the extension.
|
||||||
|
(and (or (string-contains type "z")
|
||||||
|
(string=? type "tar"))
|
||||||
|
type)))
|
||||||
(_
|
(_
|
||||||
"gz")))
|
"gz")))
|
||||||
((url signature-url)
|
((url signature-url)
|
||||||
|
|
Loading…
Reference in New Issue