From patchwork Fri Jun 7 04:56:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jens_M=C3=B8lgaard?= X-Patchwork-Id: 14254 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EC844170C5; Fri, 7 Jun 2019 06:13:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.47]) by mira.cbaines.net (Postfix) with ESMTP id 6CD57170C2 for ; Fri, 7 Jun 2019 06:13:17 +0100 (BST) Received: from localhost ([::1]:46018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZ7Bk-0004I3-Tg for patchwork@mira.cbaines.net; Fri, 07 Jun 2019 01:13:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41171) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZ7BZ-0004Ht-5d for guix-patches@gnu.org; Fri, 07 Jun 2019 01:13:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZ7BX-0000iR-B5 for guix-patches@gnu.org; Fri, 07 Jun 2019 01:13:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZ7BW-0000ho-ID for guix-patches@gnu.org; Fri, 07 Jun 2019 01:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hZ7BW-0002MH-AM for guix-patches@gnu.org; Fri, 07 Jun 2019 01:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36112] [PATCH] gnu: aspell.scm: Fix dictionaries with underscore/uppercase in name. Resent-From: Jens =?utf-8?b?TcO4bGdhYXJk?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Jun 2019 05:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36112 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 36112-submit@debbugs.gnu.org id=B36112.15598843529019 (code B ref 36112); Fri, 07 Jun 2019 05:13:02 +0000 Received: (at 36112) by debbugs.gnu.org; 7 Jun 2019 05:12:32 +0000 Received: from localhost ([127.0.0.1]:51176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZ7B1-0002LP-JU for submit@debbugs.gnu.org; Fri, 07 Jun 2019 01:12:32 -0400 Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hZ7Ay-0002LE-G2 for 36112@debbugs.gnu.org; Fri, 07 Jun 2019 01:12:30 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1559883421; cv=none; d=zoho.com; s=zohoarc; b=mQSP/NGA3z7wYZs9qY5mOmUsHH9ETMTavP8WzgQm48ycpvJbql2lutzZFMaAgjwH5QvEk34A9xJ75E4zPdXOEhj1hEcStGLf+PJl8iK0WgP6TwDjfBamIRkfxTodqQDLcN6ja6LQZiJq6FUw2tOCC187hrmJG4pGk89YuRmiAKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559883421; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=A6bvjTTeFErkrkCCuaa/7L6nU9iG9O8i1DvXJKIPiO0=; b=MhMVnqXoX9t8OO3Hm53CkOO1QCfVtEy8e7UnyyLtXLUDkKLI56xwZwe1zTN5jva1KnxgIJS9BTP4JYmdwH4PLum1EplqlnxY7pPLRXkbe1hawiwrWAUHc0rgm0ez2TTWrEZRbKndhNu6HRad3ujLd1kM8l51eLzyh25jguLf9Dw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zete.tk; spf=pass smtp.mailfrom=jens@zete.tk; dmarc=pass header.from= header.from= Received: from localhost (118.148.111.219 [118.148.111.219]) by mx.zohomail.com with SMTPS id 1559883420010500.6224723593865; Thu, 6 Jun 2019 21:57:00 -0700 (PDT) From: Jens =?utf-8?b?TcO4bGdhYXJk?= In-Reply-To: <87tvd2lo0t.fsf@gnu.org> References: <871s07jmi9.fsf@zete.tk> <87tvd2lo0t.fsf@gnu.org> User-Agent: Emacs/26.2 (x86_64-pc-linux-gnu) Date: Fri, 07 Jun 2019 16:56:57 +1200 Message-ID: <87r286ngbq.fsf@zete.tk> MIME-Version: 1.0 X-Zoho-Virus-Status: 1 X-ZohoMailClient: External X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 36112@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Thank you for the handholding, by the way... ;-) Ludovic Courtès writes: > What about avoiding regexps with something like: > > (string-map (match-lambda > (#\_ #\-) > (chr chr)) > (string-downcase dict-name)) > > ? Yeah, that looks a lot nicer / more scheme-y to me as well. Was trying to find something to use with string-map. > > Please provide a ChangeLog-style commit log. :-) > > https://gnu.org/software/guix/manual/en/html_node/Submitting-Patches.html > How is this one? From f2c43296e7e76d6343749f0fa04b0b9223710bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= Date: Thu, 6 Jun 2019 17:06:56 +1200 Subject: [PATCH] gnu: aspell.scm: Handle dictionary names with underscore/uppercase. * gnu/packages/aspell.scm(aspell-dictionary): Generate package name from upstream name. (aspell-dict-pt-pt, aspell-dict-pt-br): Use upstream name for URL. --- gnu/packages/aspell.scm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gnu/packages/aspell.scm b/gnu/packages/aspell.scm index 1bbe57a4ef..cbc9baeeb3 100644 --- a/gnu/packages/aspell.scm +++ b/gnu/packages/aspell.scm @@ -32,7 +32,8 @@ #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages compression) - #:use-module (gnu packages perl)) + #:use-module (gnu packages perl) + #:use-module (ice-9 match)) (define-public aspell (package @@ -102,7 +103,14 @@ dictionaries, including personal ones.") (define* (aspell-dictionary dict-name full-name #:key version sha256 (prefix "aspell6-")) (package - (name (string-append "aspell-dict-" dict-name)) + (name (string-append + "aspell-dict-" + ;; Downcase and replace underscore in package names + ;; to follow Guix naming conventions. + (string-map (match-lambda + (#\_ #\-) + (chr chr)) + (string-downcase dict-name)))) (version version) (source (origin (method url-fetch) @@ -281,7 +289,7 @@ dictionaries, including personal ones.") "0w2k5l5rbqpliripgqwiqixz5ghnjf7i9ggbrc4ly4vy1ia10rmc"))) (define-public aspell-dict-pt-br - (aspell-dictionary "pt-br" "Brazilian Portuguese" + (aspell-dictionary "pt_BR" "Brazilian Portuguese" #:version "20090702-0" #:prefix "aspell6-" #:sha256 @@ -289,7 +297,7 @@ dictionaries, including personal ones.") "1y09lx9zf2rnp55r16b2vgj953l3538z1vaqgflg9mdvm555bz3p"))) (define-public aspell-dict-pt-pt - (aspell-dictionary "pt-pt" "Portuguese" + (aspell-dictionary "pt_PT" "Portuguese" #:version "20070510-0" #:prefix "aspell6-" #:sha256 -- 2.21.0