public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: python@gentoo.org
Subject: Re: [gentoo-dev] [New eclass] twisted-r1.eclass
Date: Sat, 3 Aug 2013 17:54:42 +0200	[thread overview]
Message-ID: <20989.10178.719868.528622@a1i15.kph.uni-mainz.de> (raw)
In-Reply-To: <20130803171303.18911eba@gentoo.org>

>>>>> On Sat, 3 Aug 2013, Michał Górny wrote:

> 2. The eclass comes with a pure bash-3.2 CamelCase converter for
> changing PNs like 'twisted-foo' into 'TwistedFoo'. The relevant code
> can be moved to eutils as portable replacements for bash-4 ${foo^}
> and friends.

>		# obtain octal ASCII code for the first letter.
>		local ord=$(printf '%o' "'${fl}")
>
>		# check if it's [a-z]. ASCII codes are locale-safe.
>		if [[ ${ord} -ge 141 && ${ord} -le 172 ]]; then
>			# now substract 040 to make it upper-case.
>			# fun fact: in range 0141..0172, decimal '- 40' is fine.
>			local ord=$(( ${ord} - 40))
>			# and convert it back to the character.
>			fl=$(printf '\'${ord})
>		fi

This looks just horrible. You do decimal arithmetic on octal numbers?

Ulrich


  reply	other threads:[~2013-08-03 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-03 15:13 [gentoo-dev] [New eclass] twisted-r1.eclass Michał Górny
2013-08-03 15:54 ` Ulrich Mueller [this message]
2013-08-03 18:29   ` Michał Górny
2013-08-03 19:37     ` Ulrich Mueller
2013-08-03 19:42       ` Michał Górny
2013-08-03 19:37     ` Alex Xu
2013-08-03 19:47       ` Alex Xu
2013-08-03 19:49       ` Michał Górny
2013-08-03 21:57 ` Michał Górny
2013-08-03 22:28 ` Michał Górny
2013-08-04  5:15 ` [gentoo-dev] " Marien Zwart
2013-08-04  7:34   ` Michał Górny
2013-08-04 12:37 ` [gentoo-dev] " Michał Górny

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=20989.10178.719868.528622@a1i15.kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=python@gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox