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 1OMGhc-0006at-O5 for garchives@archives.gentoo.org; Wed, 09 Jun 2010 08:32:01 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A46BBE07AF; Wed, 9 Jun 2010 08:31:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5D6B3E072D for ; Wed, 9 Jun 2010 08:31:11 +0000 (UTC) Received: from [10.34.216.50] (unknown [213.87.90.108]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 6D9C36505A for ; Wed, 9 Jun 2010 08:31:02 +0000 (UTC) Subject: [gentoo-dev] LINGUAS handling From: Peter Volkov To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" Date: Wed, 09 Jun 2010 11:38:27 +0400 Message-ID: <1276069107.16507.475.camel@tablet> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.28.3.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 487f43bb-09d0-4ccc-b5c8-7276ebc27c0a X-Archives-Hash: 0b10e60706ff8b488ec6b496cbf807f2 Hi. We have LINGUAS support in portage for quite some time now, but how do we handle LINGUAS? It's not as evident as it seems and thus we need some guidelines. So I'll formulate few questions below but first let's look how portage works with LINGUAS. If you know this skip to Questions section below. Portage/gettext --------------- Like USE variable LINGUAS value could be set by user in /etc/make.conf, package.keywords or environment. There are three different cases: 1) LINGUAS set to some value, 2) LINGUAS set and contains '*'[1] 3) LINGUAS unset. portage will treat this cases differently for ebuilds with linguas_ in IUSE and without. This makes 6 cases: 1. In case LINGUAS is set and ebuild has no linguas_ in IUSE portage exports LINGUAS as is. 2. In case LINGUAS is set and IUSE contains linguas_ portage exports intersection of languages in LINGUAS and IUSE. E.g. LINGUAS set to "lang1 lang2" and IUSE contains "linguaus_ linguaus_" portage will export LINGUAS="lang1". 3. In case LINGUAS contains '*' and there is no linguaus_ in IUSE portage unsets LINGUAS. 4. In case LINGUAS contains '*' and IUSE contains linguas_ portage exports LINGUAS with langs defined in the IUSE's linguas_. 5. If LINGUAS is unset and ebuild has no linguas_ flag portage unsets LINGUAS. 6. In case LINGUAS is unset and IUSE contains linguas_ portage exports LINGUAS="". | ebuild contains linguas_ the IUSE | --------------------------------------------------| | no | yes | ------------------------------------------------------------------- LINGUAS unset | LINGUAS unset | LINGUAS='' | ------------------------------------------------------------------| LINGUAS has '*' | LINGUAS unset | LINGUAS='lang' | ------------------------------------------------------------------- LINGUAS set |LINGUAS set literally|LINGUAS set to intersection| | |of lang in IUSE and LINGUAS| ------------------------------------------------------------------- BTW, I guess all above is applicable to all USE_EXPANDED variables. But unlike other variables LINGUAS is used by gettext and in case it is unset gettext installs all translations. Questions --------- 1. Do we want all packages to support LINGUAS if possible? It is possible to leave gettext based package without LINGUAS and everything will just work, but I think that it's good idea to make supported languages visible to user through linguas_ flags. 2. How should we handle case of unset LINGUAS in ebuild? Should we mimic gettext and install all supported languages, using code like LINGUAS=${LINGUAS-%UNSET%} if test "%UNSET%" == "$LINGUAS"; then # install all supported languages fi ? If yes, it's easy to write such code and put in eclass. If no, how do we live with inconsistency that some packages will install all languages some, will install nothing (document in handbook and add portage warning in case LINGUAS is unset?)? 3. What is the purpose of strip-linguas function (mentioned in devmanual)? It's clear what it does but I have no ideas why. Probably similar code could be used in QA function that will gather supported languages from po directories and warn maintainer that it's time to update linguas_ in IUSE (and probably later it could be expanded to support qt packages too). [1] or equivalently linguas_* is set in package.use -- Peter.