upstream: Handle the case where the file name has no extension.

Fixes <https://bugs.gnu.org/42504>.
Reported by Alexandru-Sergiu Marton <brown121407@posteo.ro>.

* guix/upstream.scm (package-update/url-fetch): Handle the case where the
file name has no extension.
This commit is contained in:
Danny Milosavljevic 2020-07-27 13:33:39 +02:00
parent 069da2433e
commit bc76f8b1f9
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5

@ -369,7 +369,7 @@ SOURCE, an <upstream-source>."
(let*-values (((archive-type)
(match (and=> (package-source package) origin-uri)
((? string? uri)
(let ((type (file-extension (basename uri))))
(let ((type (or (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.