1 |
commit: fa12fe254733ca3e6edf5659522da7e048f53adc |
2 |
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 30 21:06:00 2016 +0000 |
4 |
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 30 21:19:10 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=fa12fe25 |
7 |
|
8 |
equery: Change option --ignore-linguas to --ignore-l10n |
9 |
|
10 |
Change the option to filter out the L10N USE expanded flag. This is to |
11 |
support the transition from using LINGUAS for localization in ebuilds. |
12 |
|
13 |
pym/gentoolkit/equery/uses.py | 15 ++++++++------- |
14 |
1 file changed, 8 insertions(+), 7 deletions(-) |
15 |
|
16 |
diff --git a/pym/gentoolkit/equery/uses.py b/pym/gentoolkit/equery/uses.py |
17 |
index adf8b6c..79f1118 100644 |
18 |
--- a/pym/gentoolkit/equery/uses.py |
19 |
+++ b/pym/gentoolkit/equery/uses.py |
20 |
@@ -35,7 +35,7 @@ from gentoolkit.flag import get_flags, reduce_flags |
21 |
# Globals |
22 |
# ======= |
23 |
|
24 |
-QUERY_OPTS = {"all_versions" : False, "ignore_linguas" : False} |
25 |
+QUERY_OPTS = {"all_versions" : False, "ignore_l10n" : False} |
26 |
|
27 |
# ========= |
28 |
# Functions |
29 |
@@ -57,7 +57,7 @@ def print_help(with_description=True): |
30 |
print(format_options(( |
31 |
(" -h, --help", "display this help message"), |
32 |
(" -a, --all", "include all package versions"), |
33 |
- (" -i, --ignore-linguas", "don't show linguas USE flags") |
34 |
+ (" -i, --ignore-l10n", "don't show l10n USE flags") |
35 |
))) |
36 |
|
37 |
|
38 |
@@ -187,9 +187,10 @@ def get_output_descriptions(pkg, global_usedesc): |
39 |
usevar = reduce_flags(iuse) |
40 |
usevar.sort() |
41 |
|
42 |
- if QUERY_OPTS['ignore_linguas']: |
43 |
+ if QUERY_OPTS['ignore_l10n']: |
44 |
for a in usevar[:]: |
45 |
- if a.startswith("linguas_"): |
46 |
+ #TODO: Remove linguas after transition to l10n is complete |
47 |
+ if a.startswith("l10n_") or a.startswith("linguas_"): |
48 |
usevar.remove(a) |
49 |
|
50 |
|
51 |
@@ -244,8 +245,8 @@ def parse_module_options(module_opts): |
52 |
sys.exit(0) |
53 |
elif opt in ('-a', '--all'): |
54 |
QUERY_OPTS['all_versions'] = True |
55 |
- elif opt in ('-i', '--ignore-linguas'): |
56 |
- QUERY_OPTS['ignore_linguas'] = True |
57 |
+ elif opt in ('-i', '--ignore-l10n'): |
58 |
+ QUERY_OPTS['ignore_l10n'] = True |
59 |
|
60 |
|
61 |
def print_legend(): |
62 |
@@ -261,7 +262,7 @@ def main(input_args): |
63 |
"""Parse input and run the program""" |
64 |
|
65 |
short_opts = "hai" |
66 |
- long_opts = ('help', 'all', 'ignore-linguas') |
67 |
+ long_opts = ('help', 'all', 'ignore-l10n') |
68 |
|
69 |
try: |
70 |
module_opts, queries = gnu_getopt(input_args, short_opts, long_opts) |