1 |
commit: 94400f8304150d9d785f476a80b96102af083fad |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 28 22:42:51 2016 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 28 23:34:15 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94400f83 |
7 |
|
8 |
chromium-2.eclass: convert from LINGUAS to L10N |
9 |
|
10 |
eclass/chromium-2.eclass | 42 +++++++++++++----------------------------- |
11 |
1 file changed, 13 insertions(+), 29 deletions(-) |
12 |
|
13 |
diff --git a/eclass/chromium-2.eclass b/eclass/chromium-2.eclass |
14 |
index 4833914..e9a84cb 100644 |
15 |
--- a/eclass/chromium-2.eclass |
16 |
+++ b/eclass/chromium-2.eclass |
17 |
@@ -1,4 +1,4 @@ |
18 |
-# Copyright 1999-2015 Gentoo Foundation |
19 |
+# Copyright 1999-2016 Gentoo Foundation |
20 |
# Distributed under the terms of the GNU General Public License v2 |
21 |
# $Id$ |
22 |
|
23 |
@@ -43,7 +43,7 @@ chromium_suid_sandbox_check_kernel_config() { |
24 |
# @DESCRIPTION: |
25 |
# List of language packs available for this package. |
26 |
|
27 |
-_chromium_set_linguas_IUSE() { |
28 |
+_chromium_set_l10n_IUSE() { |
29 |
[[ ${EAPI:-0} == 0 ]] && die "EAPI=${EAPI} is not supported" |
30 |
|
31 |
local lang |
32 |
@@ -51,29 +51,14 @@ _chromium_set_linguas_IUSE() { |
33 |
# Default to enabled since we bundle them anyway. |
34 |
# USE-expansion will take care of disabling the langs the user has not |
35 |
# selected via LINGUAS. |
36 |
- IUSE+=" +linguas_${lang}" |
37 |
+ IUSE+=" +l10n_${lang}" |
38 |
done |
39 |
} |
40 |
|
41 |
if [[ ${CHROMIUM_LANGS} ]]; then |
42 |
- _chromium_set_linguas_IUSE |
43 |
+ _chromium_set_l10n_IUSE |
44 |
fi |
45 |
|
46 |
-_chromium_crlang() { |
47 |
- echo "${@/_/-}" |
48 |
-} |
49 |
- |
50 |
-_chromium_syslang() { |
51 |
- echo "${@/-/_}" |
52 |
-} |
53 |
- |
54 |
-_chromium_strip_pak() { |
55 |
- local x |
56 |
- for x in "$@"; do |
57 |
- echo "${x%.pak}" |
58 |
- done |
59 |
-} |
60 |
- |
61 |
# @FUNCTION: chromium_remove_language_paks |
62 |
# @USAGE: |
63 |
# @DESCRIPTION: |
64 |
@@ -81,30 +66,29 @@ _chromium_strip_pak() { |
65 |
# not selected via the LINGUAS variable. |
66 |
# Also performs QA checks to ensure CHROMIUM_LANGS has been set correctly. |
67 |
chromium_remove_language_paks() { |
68 |
- local crlangs=$(_chromium_crlang ${CHROMIUM_LANGS}) |
69 |
- local present_crlangs=$(_chromium_strip_pak *.pak) |
70 |
- local present_langs=$(_chromium_syslang ${present_crlangs}) |
71 |
- local lang |
72 |
+ local lang pak |
73 |
|
74 |
# Look for missing pak files. |
75 |
- for lang in ${crlangs}; do |
76 |
- if ! has ${lang} ${present_crlangs}; then |
77 |
+ for lang in ${CHROMIUM_LANGS}; do |
78 |
+ if [[ ! -e ${lang}.pak ]]; then |
79 |
eqawarn "LINGUAS warning: no .pak file for ${lang} (${lang}.pak not found)" |
80 |
fi |
81 |
done |
82 |
|
83 |
# Look for extra pak files. |
84 |
# Remove pak files that the user does not want. |
85 |
- for lang in ${present_langs}; do |
86 |
- if [[ ${lang} == en_US ]]; then |
87 |
+ for pak in *.pak; do |
88 |
+ lang=${pak%.pak} |
89 |
+ |
90 |
+ if [[ ${lang} == en-US ]]; then |
91 |
continue |
92 |
fi |
93 |
if ! has ${lang} ${CHROMIUM_LANGS}; then |
94 |
eqawarn "LINGUAS warning: no ${lang} in LANGS" |
95 |
continue |
96 |
fi |
97 |
- if ! use linguas_${lang}; then |
98 |
- rm "$(_chromium_crlang ${lang}).pak" || die |
99 |
+ if ! use l10n_${lang}; then |
100 |
+ rm "${pak}" || die |
101 |
fi |
102 |
done |
103 |
} |