summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/pypi.scm12
-rw-r--r--guix/import/snix.scm10
2 files changed, 18 insertions, 4 deletions
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 <davet@gnu.org>
;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com>
-;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -194,7 +194,15 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(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)))))
diff --git a/guix/import/snix.scm b/guix/import/snix.scm
index 033b7165d3..bc75cbfda5 100644
--- a/guix/import/snix.scm
+++ b/guix/import/snix.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,7 +31,13 @@
#:use-module (srfi srfi-37)
#:use-module (system foreign)
#:use-module (rnrs bytevectors)
- #:use-module (guix utils)
+
+ ;; Use the 'package-name->name+version' procedure that works with
+ ;; hyphen-separate name/version, not the one that works with '@'-separated
+ ;; name/version. Subtle!
+ #:use-module ((guix utils) #:hide (package-name->name+version))
+ #:use-module ((guix build utils) #:select (package-name->name+version))
+
#:use-module (guix import utils)
#:use-module (guix base32)
#:use-module (guix config)