Merge pull request #175 from codeworkx/master

localecfg: only restore locale.gen.bak if available
This commit is contained in:
Manjaro Linux 2014-11-28 20:28:42 +01:00
commit f0184ab340

View File

@ -33,11 +33,13 @@ def run():
install_path = libcalamares.globalstorage.value("rootMountPoint") install_path = libcalamares.globalstorage.value("rootMountPoint")
# run locale-gen if detected # restore backup if available
if os.path.exists('/etc/locale.gen'): if os.path.exists('/etc/locale.gen.bak'):
shutil.copy2('%s/etc/locale.gen.bak' % shutil.copy2('%s/etc/locale.gen.bak' %
(install_path), '%s/etc/locale.gen' % (install_path)) (install_path), '%s/etc/locale.gen' % (install_path))
# run locale-gen if detected
if os.path.exists('/etc/locale.gen'):
text = [] text = []
with open("%s/etc/locale.gen" % install_path, "r") as gen: with open("%s/etc/locale.gen" % install_path, "r") as gen:
text = gen.readlines() text = gen.readlines()