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 1MTCNy-0002oY-Sy for garchives@archives.gentoo.org; Tue, 21 Jul 2009 10:15:51 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AEAF0E030B; Tue, 21 Jul 2009 10:15:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5D95DE030B for ; Tue, 21 Jul 2009 10:15:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 078C76573B for ; Tue, 21 Jul 2009 10:15:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -1.476 X-Spam-Level: X-Spam-Status: No, score=-1.476 required=5.5 tests=[AWL=0.056, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1, RCVD_NUMERIC_HELO=2.067] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qfr+6sldRO84 for ; Tue, 21 Jul 2009 10:15:42 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 04625664F4 for ; Tue, 21 Jul 2009 10:15:36 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MTCNf-0001oa-FF for gentoo-devhelp@gentoo.org; Tue, 21 Jul 2009 10:15:31 +0000 Received: from 91.85.167.86 ([91.85.167.86]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jul 2009 10:15:31 +0000 Received: from slong by 91.85.167.86 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Jul 2009 10:15:31 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-devhelp@lists.gentoo.org From: Steven J Long Subject: [gentoo-devhelp] Re: LINGUAS vs LANGUAGES Date: Tue, 21 Jul 2009 11:13:25 +0100 Organization: Friendly-Coders Message-ID: <23125183.lyQsYuCQA3@news.friendly-coders.info> References: <4A0D8068.3090304@arcor.de> <6142e6140905150801y7d9a6698obe04cb1c1dd01ca@mail.gmail.com> <4A0D99DC.1090502@googlemail.com> 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: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 91.85.167.86 Sender: news X-Archives-Salt: b287cf5d-63ee-4a8a-8991-6f4451a5a1ef X-Archives-Hash: 198d11d83bf2f6d15184d3f0f2755f72 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="de" > for i in ${LANGUAGES}; do > IUSE="${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=(bar baz quux) $ echo "prefixed: '${foo[*]/#/pfx_}'" prefixed: 'pfx_bar pfx_baz pfx_quux' Parameter Expansion (incl on arrays) is discussed more at: http://mywiki.wooledge.org/BashFAQ/073 > src_install() > #... > insinto "${GAMES_DATADIR}/${PN}/i18n" > for i in ${LANGUAGES}; do > if has ${i} ${LINGUAS}; then > doins "${PN}_${i}.qm" || die #... > fi > done > > > In this case, LANGUAGES must not include "en" though, since there's no > ${PN}_en.qm file (English is built-in). I'm not sure if the following > would be better though, in case a user puts linguas_ in USE > instead of in LINGUAS: > > if has linguas_${i} ${USE}; then > > But I suppose it would be the user's fault if he/she does that? :P Well yeah it's not the right way to set USE_EXPAND vars; LINGUAS is, and will be handled specially since it's one of that set. -- #friendly-coders -- We're friendly but we're not /that/ friendly ;-)