Gentoo Archives: gentoo-dev

From: Dan Douglas <ormaaj@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: RFC: New eclass: mozlinguas.eclass
Date: Fri, 03 Feb 2012 22:17:43
Message-Id: 2118153.jVE1AKz8Yi@smorgbox
In Reply to: Re: [gentoo-dev] Re: RFC: New eclass: mozlinguas.eclass by Nirbheek Chauhan
1 On Friday, February 03, 2012 10:14:42 PM Nirbheek Chauhan wrote:
2 > >> if [[ ${x} = en ]] || [[ ${x} = en-US ]]; then
3 > >
4 > > should be == imo
5 >
6 > Fixed
7
8 I prefer == for [[ too, but no difference. = is required for [ by POSIX but
9 Bash allows either (bad though). The real issue is executing two commands
10 since [[ can short-circuit and works as you expect. Two are only needed with [
11 because -a and -o are so unpredictable.
12
13 [[ $x == en || $x == en-US ]]
14 or
15 case $x in en|en-US) ...;; esac;
16 or
17 [[ $x == @(en|en-US) ]]
18 or
19 [[ $x == en?(-US) ]]
20 --
21 Dan Douglas

Attachments

File name MIME type
signature.asc application/pgp-signature