the first character must be a comment
to original code would match both lines: zen_US.UTF-8 UTF-8 #en_US.UTF-8 UTF-8 introducing "#" should check only the commented lines
This commit is contained in:
parent
e7e4a8d783
commit
9d1c3e2669
@ -65,15 +65,12 @@ def run():
|
|||||||
with open("{!s}/etc/locale.gen".format(install_path), "w") as gen:
|
with open("{!s}/etc/locale.gen".format(install_path), "w") as gen:
|
||||||
for line in text:
|
for line in text:
|
||||||
# always enable en_US
|
# always enable en_US
|
||||||
if line.startswith(en_us_locale, 1):
|
if line.startswith("#" + en_us_locale):
|
||||||
# uncomment line
|
# uncomment line
|
||||||
line = line[1:].lstrip()
|
line = line[1:].lstrip()
|
||||||
|
|
||||||
for locale_value in locale_values:
|
for locale_value in locale_values:
|
||||||
# check the locale value starting from
|
if line.startswith("#" + locale_value):
|
||||||
# the second index because we expect that
|
|
||||||
# the first one is a '#'
|
|
||||||
if line.startswith(locale_value, 1):
|
|
||||||
# uncomment line
|
# uncomment line
|
||||||
line = line[1:].lstrip()
|
line = line[1:].lstrip()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user