summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/import/github.scm18
1 files changed, 13 insertions, 5 deletions
diff --git a/guix/import/github.scm b/guix/import/github.scm
index 4b7d53c704..5fd08b14bc 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -140,14 +140,18 @@ repository separated by a forward slash, from a string URL of the form
'https://github.com/arq5x/bedtools2/archive/v2.24.0.tar.gz' and the name of
the package e.g. 'bedtools2'. Return #f if there is no releases"
(let* ((token (%github-token))
- (api-url (string-append
+ (releases-api-url (string-append
"https://api.github.com/repos/"
(github-user-slash-repository url)
"/releases"))
+ (tags-api-url (string-append
+ "https://api.github.com/repos/"
+ (github-user-slash-repository url)
+ "/tags"))
(json (json-fetch*
(if token
- (string-append api-url "?access_token=" token)
- api-url))))
+ (string-append tags-api-url "?access_token=" token)
+ tags-api-url))))
(if (eq? json #f)
(if token
(error "Error downloading release information through the GitHub
@@ -163,13 +167,17 @@ https://github.com/settings/tokens"))
;; https://github.com/wwood/OrfM/releases/tag/v0.5.1
;; or an all-prerelease set
;; https://github.com/powertab/powertabeditor/releases
- (not (hash-ref x "prerelease")))
+ (and (not (hash-ref x "prerelease"))
+ (string-prefix? "release_"
+ (or (hash-ref x "tag_name")
+ (hash-ref x "name")))))
json)))
(match proper-releases
(() ;empty release list
#f)
((release . rest) ;one or more releases
- (let ((tag (hash-ref release "tag_name"))
+ (let ((tag (or (hash-ref release "tag_name")
+ (hash-ref release "name")))
(name-length (string-length package-name)))
;; some tags include the name of the package e.g. "fdupes-1.51"
;; so remove these