summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2019-01-17 01:34:07 +0530
committerArun Isaac <arunisaac@systemreboot.net>2019-01-21 17:59:15 +0530
commit6b7ea49bedb6902ee620ec337cb234a34b2ab49b (patch)
tree80747f8888aa78091a7cdb56f077f78de8216bbc /guix
parent0233bdde6ca5b2c1cfb95a0b8dfd7ee498a47330 (diff)
import: github: Use prereleases when package has no releases.
* guix/import/github.scm (latest-released-version): Use preleases when package has no releases.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/github.scm14
1 files changed, 6 insertions, 8 deletions
diff --git a/guix/import/github.scm b/guix/import/github.scm
index e17ef0b840..c78469dac5 100644
--- a/guix/import/github.scm
+++ b/guix/import/github.scm
@@ -171,6 +171,9 @@ empty list."
"Return a string of the newest released version name given a string URL like
'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"
+ (define (pre-release? x)
+ (hash-ref x "prerelease"))
+
(let* ((json (fetch-releases-or-tags url)))
(if (eq? json #f)
(if (%github-token)
@@ -181,14 +184,9 @@ API. This may be fixed by using an access token and setting the environment
variable GUIX_GITHUB_TOKEN, for instance one procured from
https://github.com/settings/tokens"))
(let loop ((releases
- (filter
- (lambda (x)
- ;; example pre-release:
- ;; 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")))
- json)))
+ (match (remove pre-release? json)
+ (() json) ; keep everything
+ (releases releases))))
(match releases
(() ;empty release list
#f)