aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-27 23:49:52 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-28 00:38:20 +0100
commit21f4a7c116ed884314f29a8dc69ed18092b35477 (patch)
treea44304a0f8d592d08b51446e29ce89993fcd7e8b
parent6715e1ff2e09af3208f8f2a108ca100798ca1058 (diff)
downloadpatches-21f4a7c116ed884314f29a8dc69ed18092b35477.tar
patches-21f4a7c116ed884314f29a8dc69ed18092b35477.tar.gz
import: github: Better tolerate unexpected file extensions.
* guix/import/github.scm (find-extension): Add ".tbz". (updated-github-url): When 'find-extension' returns #f, use "" for EXT.
-rw-r--r--guix/import/github.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/import/github.scm b/guix/import/github.scm
index 1e0bb53d9a..b249b39067 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -49,7 +49,8 @@
"Return the extension of the archive e.g. '.tar.gz' given a URL, or
false if none is recognized"
(find (lambda (x) (string-suffix? x url))
- (list ".tar.gz" ".tar.bz2" ".tar.xz" ".zip" ".tar" ".tgz" ".love")))
+ (list ".tar.gz" ".tar.bz2" ".tar.xz" ".zip" ".tar"
+ ".tgz" ".tbz" ".love")))
(define (updated-github-url old-package new-version)
;; Return a url for the OLD-PACKAGE with NEW-VERSION. If no source url in
@@ -57,7 +58,7 @@ false if none is recognized"
(define (updated-url url)
(if (string-prefix? "https://github.com/" url)
- (let ((ext (find-extension url))
+ (let ((ext (or (find-extension url) ""))
(name (package-name old-package))
(version (package-version old-package))
(prefix (string-append "https://github.com/"