diff options
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/github.scm | 14 | ||||
-rw-r--r-- | guix/import/pypi.scm | 7 |
2 files changed, 11 insertions, 10 deletions
diff --git a/guix/import/github.scm b/guix/import/github.scm index df5f6ff32f..7136e7a34f 100644 --- a/guix/import/github.scm +++ b/guix/import/github.scm @@ -154,18 +154,16 @@ empty list." ;; Ask for version 3 of the API as suggested at ;; <https://developer.github.com/v3/>. `((Accept . "application/vnd.github.v3+json") - (user-agent . "GNU Guile"))) + (user-agent . "GNU Guile") + ,@(if (%github-token) + `((Authorization . ,(string-append "token " (%github-token)))) + '()))) - (define (decorate url) - (if (%github-token) - (string-append url "?access_token=" (%github-token)) - url)) - - (match (json-fetch (decorate release-url) #:headers headers) + (match (json-fetch release-url #:headers headers) (#() ;; We got the empty list, presumably because the user didn't use GitHub's ;; "release" mechanism, but hopefully they did use Git tags. - (json-fetch (decorate tag-url) #:headers headers)) + (json-fetch tag-url #:headers headers)) (x x))) (define (latest-released-version url package-name) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 6897f42be3..10450155a0 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> +;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -439,10 +440,12 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." (match str ("GNU LGPL" license:lgpl2.0) ("GPL" license:gpl3) - ((or "BSD" "BSD License") license:bsd-3) - ((or "MIT" "MIT license" "Expat license") license:expat) + ((or "BSD" "BSD-3" "BSD License") license:bsd-3) + ("BSD-2-Clause" license:bsd-2) + ((or "MIT" "MIT license" "MIT License" "Expat license") license:expat) ("Public domain" license:public-domain) ((or "Apache License, Version 2.0" "Apache 2.0") license:asl2.0) + ("MPL 2.0" license:mpl2.0) (_ #f))) (define (pypi-package? package) |