From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Mbfym-0004x9-Qg for garchives@archives.gentoo.org; Thu, 13 Aug 2009 19:28:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 59531E051A; Thu, 13 Aug 2009 19:28:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 39C85E051A for ; Thu, 13 Aug 2009 19:28:52 +0000 (UTC) Received: from vapier.localnet (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id A885966E76 for ; Thu, 13 Aug 2009 19:28:51 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: gentoo-devhelp@lists.gentoo.org Subject: Re: [gentoo-devhelp] Re: Re: LINGUAS vs LANGUAGES Date: Thu, 13 Aug 2009 15:28:50 -0400 User-Agent: KMail/1.11.4 (Linux/2.6.30.3; KDE/4.2.4; x86_64; ; ) References: <4A0D8068.3090304@arcor.de> <200907261651.44164.vapier@gentoo.org> <13017217.uNbVpHm14s@news.friendly-coders.info> In-Reply-To: <13017217.uNbVpHm14s@news.friendly-coders.info> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Development-related help X-BeenThere: gentoo-devhelp@gentoo.org X-BeenThere: gentoo-devhelp@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2012498.q8ldiNfKCX"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200908131528.50897.vapier@gentoo.org> X-Archives-Salt: aecf4472-49bf-429d-91de-6ce2dd58c254 X-Archives-Hash: 6b751f58cb72451045dccb4144cac80d --nextPart2012498.q8ldiNfKCX Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 01 August 2009 11:22:41 Steven J Long wrote: > Mike Frysinger wrote: > > On Tuesday 21 July 2009 06:13:25 Steven J Long wrote: > >> Nikos Chantziaras wrote: > >> > Thanks. I ended up doing it this way, though with only one loop in > >> > src_install(), which seems to be a bit more efficient and shorter: > >> > > >> > > >> > LANGUAGES=3D"de" > >> > for i in ${LANGUAGES}; do > >> > IUSE=3D"${IUSE} linguas_${i}" > >> > done > >> > >> Just on a side-note (not saying it's how you want to do this one), this > >> is something that BASH arrays are nice for (saving another loop): > >> $ foo=3D(bar baz quux) > >> $ echo "prefixed: '${foo[*]/#/pfx_}'" > >> prefixed: 'pfx_bar pfx_baz pfx_quux' > > > > printf would probably be better as it is typically a shell builtin and = it > > doesnt require use of arrays/uncommon syntax. > > media-gfx/exiv2/exiv2-0.18.ebuild: > > IUSE_LINGUAS=3D"de es fi fr pl ru sk" > > IUSE=3D"${IUSE} $(printf 'linguas_%s ' ${IUSE_LINGUAS})" > > Doh, forgot about printf. (We have alias print=3D"printf '%s\n'" in our l= ib > code which comes in handy too.) Nice one. > > The only issue with the above is that it requires a subshell; forking isn= 't > cheap (especially on Interix/cygwin/doze) and in general it's considered a > bit lame (at least amongst the ##bash old-timers that I bump heads with) = to > need forking in BASH, though ofc not in SH, which is why it might not be > the best here, since the metadata generation phase is a restricted subset > of SH, leave alone BASH, at least aiui. forks are cheap on any sane *nix box, and subshells/builtins are better tha= n=20 external programs. i'm pretty sure the overhead here tends to be less than= =20 the overhead of running for loops, especially as the LINGUAS gets bigger. =2Dmike --nextPart2012498.q8ldiNfKCX Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) iQIcBAABAgAGBQJKhGlyAAoJEEFjO5/oN/WBUR4QAOHLB1Z5axhxl4br3ldZHa7R vkIVFH+byhilcR6GbfLeA/OQH7dG3GQuaUXd2ODRXlgaNAU1HGjFuhhZJgDuuxEO oCP2LAedQgisBUl8qdYY3Jwp7LrVeFiNwM8Dmq+jqwqmAgk6Td9qNZmLxvr8QJRQ GJ+SwzlpZMZ5gIhVELLweDBAhcfQg5NbZXQ8owsPItdrxroHbO/F+9wYuOgxYT22 Uz0/GL2mk4D1ihf33ggbzqlWtNku5frIsbixRBcc7zkWtuwpWrFgEsAMcRSceQPt 2MsJAdFrNdxtb8CYA8Oj/0g35mSg68Ge8k544d7Fhvl9+8yrUghXIKLMR+oMVF3t LhtKaTEx//lNi44bprhchBW3txQ+wn4sy4kRFIK0wlWMqZV5ooLszHMoDigC9LSZ ETiWtpKdQE3GlwHl9+I0gP9ak6rWl23XS8sGxwFRy8i6hYFZUWibwkJFaNQY2Trn 77KpLdqG7t4OJguYyx+hJsnvfjxnDcW09McWf/QzV/uvdN79cVK8hm4FGgoZUPi2 L1hEvcCrLV8QQgN2AsI9BqOxkqLBMwJjMyOpci2KNyc5ydFBjzjaLQNh+MtJN3Fo EQafvAfrXbQftx24AJf+3LixliQzc/+3gfXy07y6QoTA++C31XQtqfHwE/y7Hgx1 RLLko8DBmJcOw+ZnuYg9 =cczW -----END PGP SIGNATURE----- --nextPart2012498.q8ldiNfKCX--