Gentoo Archives: gentoo-dev

From: "René 'Necoro' Neumann" <lists@××××××.eu>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
Date: Fri, 09 Nov 2007 09:14:49
Message-Id: 47342412.5090000@necoro.eu
In Reply to: Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass by Ingmar Vanhassel
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Ingmar Vanhassel schrieb:
5 > 2007/11/9, René 'Necoro' Neumann <lists@××××××.eu>:
6 >> Steve Long schrieb:
7 >>> René 'Necoro' Neumann wrote:
8 >>>> cmake-utils_src_enable python => -DENABLE_python=...
9 >>>>
10 >>>> Wanted would be that it returned -DENABLE_PYTHON=...
11 >>>>
12 >>>> I'm not into bash scripting that much, so I do not know a way to do so -
13 >>>> but I guess someone else is ;)
14 >>>>
15 >>> Unfortunately BASH doesn't support ksh93 or zsh style casting to
16 >> uppercase.
17 >>> The best way really is via tr:
18 >>> alias toUpper='tr [[:lower:]] [[:upper:]]'
19 >>> alias toLower='tr [[:upper:]] [[:lower:]]'
20 >>>
21 >>> (er aliases don't normally work in scripts, but you get the idea.) Bear in
22 >>> mind that tr reads stdin and writes to stdout. It has the advantage of
23 >>> being locale-safe. Every other method I've looked at is much slower and
24 >>> only works with ASCII.
25 >>>
26 >>> A function wouldn't be too hard:
27 >>> toUpper() {
28 >>> for i; do
29 >>> echo "$i" |tr [[:lower:]] [[:upper:]]
30 >>> done
31 >>> }
32 >>>
33 >>> Usage depends on the parameters you pass.
34 >>> var=$(toUpper $var) # for single vars with no newlines in
35 >> This is right the version I've chosen ... so with the help of Steve: a
36 >> small patch ;)
37 >>
38 >> Regards,
39 >> Necoro
40 >
41 > Hi Necoro,
42 >
43 > You can just use 'cmake-utils_use_enable python PYTHON'
44 >
45 > It's mentioned in the cmake-utils.eclass manpage (app-portage/eclass-manpages),
46 > as well as in the patch you just sent: cmake-utils_use_enable <USE
47 > flag> [flag name]
48 >
49 > :-)
50 >
51 > Regards,
52 > Ingmar Vanhassel
53 > ���^����(� ��X��X�t===
54 I know this :) ... and this is how I did this at the moment.
55 But as I think, that the uppercase version is the common behavior here,
56 it should not need this extra "PYTHON". :) That's why the patch ;)
57
58 Regards,
59 Necoro
60 -----BEGIN PGP SIGNATURE-----
61 Version: GnuPG v1.4.7 (GNU/Linux)
62 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
63
64 iD8DBQFHNCQS4UOg/zhYFuARAmdhAJ9idOAgUEX7GIvQrkDIIOT8heg5YgCfdSAM
65 09YrI9Nky6kmKVNg4Egafgk=
66 =ZT15
67 -----END PGP SIGNATURE-----
68 --
69 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass "Wulf C. Krueger" <philantrop@g.o>