[localecfg] Fix mismatch between filenames

Testing for existence of a file in the live system, and then
copying it in the target system, is not a recipe for success.

 - Fix the restore-from-backup part.
 - Document that your live and target system must both have
   /etc/locale.gen if you want this to work at all.
This commit is contained in:
Adriaan de Groot 2018-06-19 08:56:37 -04:00
parent 7498629b5f
commit efc977f7b4

View File

@ -54,11 +54,12 @@ def run():
target_etc_default_path = "{!s}/etc/default".format(install_path)
# restore backup if available
if os.path.exists('/etc/locale.gen.bak'):
shutil.copy2(target_locale_gen_bak,
target_locale_gen)
if os.path.exists(target_locale_gen_bak):
shutil.copy2(target_locale_gen_bak, target_locale_gen)
# run locale-gen if detected
# run locale-gen if detected; this *will* cause an exception
# if the live system has locale.gen, but the target does not:
# in that case, fix your installation filesystem.
if os.path.exists('/etc/locale.gen'):
text = []