From 8192712f8108d0abcd527ff6b16af073c453b780 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 14 May 2019 15:46:19 +0530 Subject: [PATCH 2/2] import: github: Sort releases before picking the latest one. * guix/import/github.scm (latest-released-version): Sort releases before picking the first one as the latest. --- guix/import/github.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/guix/import/github.scm b/guix/import/github.scm index 5f4d9c7267..cdac70420a 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -206,10 +206,13 @@ API when using a GitHub token") 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")) - (any release->version - (match (remove pre-release? json) - (() json) ; keep everything - (releases releases)))))) + (match (sort (filter-map release->version + (match (remove pre-release? json) + (() json) ; keep everything + (releases releases))) + version>?) + ((latest-release . _) latest-release) + (() #f))))) (define (latest-release pkg) "Return an for the latest release of PKG." -- 2.21.0