From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 2/3] guix import pypi: do not add "python-" to a package name if it's already there. Date: Thu, 16 Oct 2014 09:47:28 +0200 Message-ID: <87d29s78xb.fsf@gnu.org> References: <1413413354-31144-1-git-send-email-tipecaml@gmail.com> <1413413354-31144-3-git-send-email-tipecaml@gmail.com> <87lhogdif9.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XefmR-0005Xi-QN for guix-devel@gnu.org; Thu, 16 Oct 2014 03:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XefmL-0005xW-M6 for guix-devel@gnu.org; Thu, 16 Oct 2014 03:47:27 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:33007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XefmL-0005wt-FO for guix-devel@gnu.org; Thu, 16 Oct 2014 03:47:21 -0400 In-Reply-To: <87lhogdif9.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Wed, 15 Oct 2014 19:25:46 -0400") 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: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > Cyril Roelandt writes: > >> * guix/import/pypi.scm (make-pypi-sexp): test whether the package name s= tarts >> with "python-" before modifying it. >> --- >> guix/import/pypi.scm | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm >> index 8f5e031..722ad9d 100644 >> --- a/guix/import/pypi.scm >> +++ b/guix/import/pypi.scm >> @@ -134,7 +134,9 @@ underscores." >> "Return the `package' s-expression for a python package with the give= n NAME, >> VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." >> `(package >> - (name ,(string-append "python-" (snake-case name))) >> + (name ,(if (eq? (string-contains name "python-") 0) > > Could we do a regexp match instead? Or (string-prefix? "python-" name) maybe? Ludo=E2=80=99.