From: "Jens Mølgaard" <jens@zete.tk>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 36112@debbugs.gnu.org
Subject: [bug#36112] [PATCH] gnu: aspell.scm: Fix dictionaries with underscore/uppercase in name.
Date: Fri, 07 Jun 2019 16:56:57 +1200 [thread overview]
Message-ID: <87r286ngbq.fsf@zete.tk> (raw)
In-Reply-To: <87tvd2lo0t.fsf@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 575 bytes --]
Thank you for the handholding, by the way... ;-)
Ludovic Courtès <ludo@gnu.org> 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?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-aspell.scm-Handle-dictionary-names-with-undersco.patch --]
[-- Type: text/x-patch, Size: 2446 bytes --]
From f2c43296e7e76d6343749f0fa04b0b9223710bb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jens=20M=C3=B8lgaard?= <jens@zete.tk>
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)<name>:
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2019-06-07 5:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 5:44 [bug#36112] [PATCH] gnu: aspell.scm: Fix dictionaries with underscore/uppercase in name Jens Mølgaard
2019-06-06 15:41 ` Ludovic Courtès
2019-06-07 4:56 ` Jens Mølgaard [this message]
2019-06-07 7:32 ` bug#36112: " 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r286ngbq.fsf@zete.tk \
--to=jens@zete.tk \
--cc=36112@debbugs.gnu.org \
--cc=ludo@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.