summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen de Groot <yngwin@gentoo.org>2012-07-15 20:00:37 +0800
committerBen de Groot <yngwin@gentoo.org>2012-07-15 20:00:37 +0800
commitd60ef11bfb1af2eaa47e4218713cc06c7ad62424 (patch)
tree77faed6a256e5cf4d8e98d4be8f680df94eae9b8
parentl10n.eclass: drop l10n_iuse (diff)
downloadyngwin-d60ef11bfb1af2eaa47e4218713cc06c7ad62424.tar.gz
yngwin-d60ef11bfb1af2eaa47e4218713cc06c7ad62424.tar.bz2
yngwin-d60ef11bfb1af2eaa47e4218713cc06c7ad62424.zip
l10n.eclass: return instead of export
-rw-r--r--eclass/l10n.eclass25
-rw-r--r--net-im/qtwitter/qtwitter-0.10.0-r10.ebuild6
2 files changed, 16 insertions, 15 deletions
diff --git a/eclass/l10n.eclass b/eclass/l10n.eclass
index fd278d2..f2918f3 100644
--- a/eclass/l10n.eclass
+++ b/eclass/l10n.eclass
@@ -40,15 +40,16 @@
# @DESCRIPTION:
# Convenience function for processing localizations. The parameter should
# be a function (defined in the consuming eclass or ebuild) which takes
-# an individual localization as parameter.
+# an individual localization as (last) parameter.
#
# Example: l10n_for_each_locale_do install_locale
l10n_for_each_locale_do() {
- l10n_get_linguas_crosssection
- if [[ -n "${L10N_LOCS}" ]]; then
+ local xlocs=
+ xlocs=$(l10n_get_linguas_crosssection)
+ if [[ -n "${xlocs}" ]]; then
local x
- for x in ${L10N_LOCS}; do
- ${1} ${x} || die "failed to process ${x} locale"
+ for x in ${xlocs}; do
+ ${@} ${x} || die "failed to process ${x} locale"
done
fi
}
@@ -66,7 +67,7 @@ l10n_for_each_unselected_locale_do() {
einfo "Unselected locales are: ${o}"
if [[ -n "${o}" ]]; then
for x in ${o}; do
- ${1} ${x} || die "failed to process unselected ${x} locale"
+ ${@} ${x} || die "failed to process unselected ${x} locale"
done
fi
}
@@ -99,19 +100,17 @@ l10n_find_plocales_changes() {
# @FUNCTION: l10n_get_linguas_crosssection
# @DESCRIPTION:
# Determine the cross-section of user-set LINGUAS and the locales which
-# the package offers (listed in PLOCALES), and export L10N_LOCS. In case
-# no locales are selected, fall back on PLOCALE_BACKUP. This function is
+# the package offers (listed in PLOCALES), and return them. In case no
+# locales are selected, fall back on PLOCALE_BACKUP. This function is
# normally used internally in this eclass, not by l10n.eclass consumers.
l10n_get_linguas_crosssection() {
- # @VARIABLE: L10N_LOCS
- # @DESCRIPTION: Selected locales (cross-section of LINGUAS and PLOCALES)
- unset L10N_LOCS
local lang= loc= xloc=
for lang in ${LINGUAS}; do
for loc in ${PLOCALES}; do
[[ ${lang} == ${loc} ]] && xloc+="${loc} "
done
done
- export L10N_LOCS="${xloc:-$PLOCALE_BACKUP}"
- einfo "Selected locales are: ${L10N_LOCS}"
+ xloc=${xloc:-$PLOCALE_BACKUP}
+ printf "%s" "${xloc}"
+# einfo "Selected locales are: ${xloc:-none}"
}
diff --git a/net-im/qtwitter/qtwitter-0.10.0-r10.ebuild b/net-im/qtwitter/qtwitter-0.10.0-r10.ebuild
index 4d46f2c..4e14959 100644
--- a/net-im/qtwitter/qtwitter-0.10.0-r10.ebuild
+++ b/net-im/qtwitter/qtwitter-0.10.0-r10.ebuild
@@ -33,10 +33,12 @@ src_prepare() {
l10n_find_plocales_changes "${S}/translations" '${PN}' '.ts'
- l10n_get_linguas_crosssection
+ local langs
+ langs="$(l10n_get_linguas_crosssection)"
+ einfo "Selected localizations are: ${langs}"
# remove translations and add only the selected ones
sed -e '/^ *LANGS/,/^$/s/^/#/' \
- -e "/LANGS =/s/.*/LANGS = ${L10N_LOCS}/" \
+ -e "/LANGS =/s/.*/LANGS = ${langs}/" \
-i translations/translations.pri || die "sed translations failed"
# fix insecure runpaths