diff --git a/src/modules/localecfg/main.py b/src/modules/localecfg/main.py index a192fa902..4b12b9311 100644 --- a/src/modules/localecfg/main.py +++ b/src/modules/localecfg/main.py @@ -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 = []