From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia Subject: [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri. Date: Sun, 3 Jan 2016 22:36:37 +0100 Message-ID: <1451856997-13507-1-git-send-email-swedebugia@riseup.net> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFqLc-0001Lt-SR for guix-devel@gnu.org; Sun, 03 Jan 2016 16:37:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFqLZ-0004DX-Mo for guix-devel@gnu.org; Sun, 03 Jan 2016 16:37:56 -0500 Received: from mx1.riseup.net ([198.252.153.129]:58385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFqLZ-0004DT-Fz for guix-devel@gnu.org; Sun, 03 Jan 2016 16:37:53 -0500 Received: from cotinga.riseup.net (unknown [10.0.1.164]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 834E21A05AD for ; Sun, 3 Jan 2016 21:37:52 +0000 (UTC) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --- guix/build-system/python.scm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index 2532210..09074ce 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -41,13 +41,20 @@ ;; ;; Code: -(define (pypi-uri name version) +(define* (pypi-uri name version + #:optional + ending) "Return a URI string for the Python package hosted on the Python Package -Index (PyPI) corresponding to NAME and VERSION." - (string-append "https://pypi.python.org/packages/source/" +Index (PyPI) corresponding to NAME, VERSION and optionally ENDING." + (when (null? ending) + (string-append "https://pypi.python.org/packages/source/" (string-take name 1) "/" name "/" - name "-" version ".tar.gz")) - + name "-" version ".tar.gz") + ;; Ending is set -> use it. + (string-append "https://pypi.python.org/packages/source/" + (string-take name 1) "/" name "/" + name "-" version "." ending))) + (define %python-build-system-modules ;; Build-side modules imported by default. `((guix build python-build-system) -- 2.6.3