Skip to content

Commit

Permalink
the first character must be a comment
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AlmAck committed Mar 3, 2018
1 parent 382c193 commit 58952b6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/modules/localecfg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,12 @@ def run():
with open("{!s}/etc/locale.gen".format(install_path), "w") as gen:
for line in text:
# always enable en_US
if line.startswith(en_us_locale, 1):
if line.startswith("#" + en_us_locale):
# uncomment line
line = line[1:].lstrip()

for locale_value in locale_values:
# check the locale value starting from
# the second index because we expect that
# the first one is a '#'
if line.startswith(locale_value, 1):
if line.startswith("#" + locale_value):
# uncomment line
line = line[1:].lstrip()

Expand Down

0 comments on commit 58952b6

Please sign in to comment.