diff options
author | Christopher Baines <christopher.baines@digital.cabinet-office.gov.uk> | 2017-04-24 06:36:04 +0100 |
---|---|---|
committer | Christopher Baines <christopher.baines@digital.cabinet-office.gov.uk> | 2017-09-07 23:12:52 +0100 |
commit | d9fccae30dac31c72113a382812912e745a1cab8 (patch) | |
tree | 0eca9a7a0e02bf172120e29f25b3f20fd72f5ac2 /guix | |
parent | 08582c63d9557992c93d8a65d835dc2471758768 (diff) | |
download | gnu-guix-d9fccae30dac31c72113a382812912e745a1cab8.tar gnu-guix-d9fccae30dac31c72113a382812912e745a1cab8.tar.gz |
Alter the GitHub updater to use git tags
Just using tags is the most consistent way of getting releases for GOV.UK
related software.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/import/github.scm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/guix/import/github.scm b/guix/import/github.scm index b249b39067..ea47043692 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -138,14 +138,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 @@ -161,13 +165,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 |