From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" 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:03:13 -0400 Message-ID: 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> <87d29s78xb.fsf@gnu.org> 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]:44194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XekiC-0003IP-FW for guix-devel@gnu.org; Thu, 16 Oct 2014 09:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xeki3-0002fq-My for guix-devel@gnu.org; Thu, 16 Oct 2014 09:03:24 -0400 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]:55919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xeki3-0002fG-G0 for guix-devel@gnu.org; Thu, 16 Oct 2014 09:03:15 -0400 Received: by mail-pa0-f50.google.com with SMTP id kx10so3356919pab.23 for ; Thu, 16 Oct 2014 06:03:13 -0700 (PDT) In-Reply-To: <87d29s78xb.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel On Thu, Oct 16, 2014 at 3:47 AM, Ludovic Court=C3=A8s wrote: > David Thompson skribis: > >> Cyril Roelandt writes: >> >>> * guix/import/pypi.scm (make-pypi-sexp): test whether the package name = starts >>> 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 giv= en 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? Cool, didn't know about that one. - Dave