From 22a9fd86dfb9b77ed4cea93325ad2955bfe2ed34 Mon Sep 17 00:00:00 2001 From: Daniel Hillenbrand Date: Fri, 28 Nov 2014 20:05:54 +0100 Subject: [PATCH] localecfg: only restore locale.gen.bak if available --- src/modules/localecfg/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/localecfg/main.py b/src/modules/localecfg/main.py index 95b8769e7..5c0de1ad7 100644 --- a/src/modules/localecfg/main.py +++ b/src/modules/localecfg/main.py @@ -33,11 +33,13 @@ def run(): install_path = libcalamares.globalstorage.value("rootMountPoint") - # run locale-gen if detected - if os.path.exists('/etc/locale.gen'): + # restore backup if available + if os.path.exists('/etc/locale.gen.bak'): shutil.copy2('%s/etc/locale.gen.bak' % (install_path), '%s/etc/locale.gen' % (install_path)) + # run locale-gen if detected + if os.path.exists('/etc/locale.gen'): text = [] with open("%s/etc/locale.gen" % install_path, "r") as gen: text = gen.readlines()