From 522773b70024272555aab0448fae8606add4c582 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 19 Mar 2016 23:49:59 +0100 Subject: import: pypi: Emit 'pypi-uri' only when it yields the right URL. Fixes . Reported by Danny Milosavljevic . * guix/import/pypi.scm (make-pypi-sexp): Check whether 'pypi-uri' returns SOURCE-URL and fall back to the full URL otherwise. * tests/pypi.scm ("pypi->guix-package"): Adjust expected URI accordingly. Co-authored-by: Danny Milosavljevic --- guix/import/pypi.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'guix/import') diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index d54bb9fbba..8ae4948147 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 David Thompson ;;; Copyright © 2015 Cyril Roelandt -;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -194,7 +194,15 @@ (define (make-pypi-sexp name version source-url home-page synopsis (version ,version) (source (origin (method url-fetch) - (uri (pypi-uri ,name version)) + + ;; Sometimes 'pypi-uri' doesn't quite work due to mixed + ;; cases in NAME, for instance, as is the case with + ;; "uwsgi". In that case, fall back to a full URL. + (uri ,(if (equal? (pypi-uri name version) source-url) + `(pypi-uri ,name version) + `(string-append + ,@(factorize-uri source-url version)))) + (sha256 (base32 ,(guix-hash-url temp))))) -- cgit v1.2.3