unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: swedebugia <swedebugia@riseup.net>
To: guix-devel@gnu.org
Subject: [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri.
Date: Sun,  3 Jan 2016 22:36:37 +0100	[thread overview]
Message-ID: <1451856997-13507-1-git-send-email-swedebugia@riseup.net> (raw)

---
 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

             reply	other threads:[~2016-01-03 21:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 21:36 swedebugia [this message]
2016-01-03 21:53 ` [PATCH] guix pypi importer: Add ending as an optional argument to pypi-uri swedebugia
2016-01-05  0:53 ` Cyril Roelandt
2016-01-05  9:58   ` Efraim Flashner
2016-01-05 10:23     ` Cyril Roelandt
2016-01-08 18:14 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451856997-13507-1-git-send-email-swedebugia@riseup.net \
    --to=swedebugia@riseup.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).