summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_install.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-09-02 19:06:59 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-09-02 19:06:59 (GMT)
commit8af79359c21b5f07981975c34a7d51ab063b249d (patch)
treec5743f14ce966f615775ef939d2893ba6231be81 /abs/core/LinHES-config/mv_install.py
parenta4058a1991691693739c60f71f3886d0ed8c058a (diff)
downloadlinhes_pkgbuild-8af79359c21b5f07981975c34a7d51ab063b249d.zip
linhes_pkgbuild-8af79359c21b5f07981975c34a7d51ab063b249d.tar.gz
linhes_pkgbuild-8af79359c21b5f07981975c34a7d51ab063b249d.tar.bz2
LinHes-config: during the install copy over the locale archive file. Generating locales during install takes to long, so the locales are generated during the creation of the iso
refs #782 closes #782
Diffstat (limited to 'abs/core/LinHES-config/mv_install.py')
-rwxr-xr-xabs/core/LinHES-config/mv_install.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/abs/core/LinHES-config/mv_install.py b/abs/core/LinHES-config/mv_install.py
index e89602b..cc4e4a6 100755
--- a/abs/core/LinHES-config/mv_install.py
+++ b/abs/core/LinHES-config/mv_install.py
@@ -37,7 +37,6 @@ def update_db(value, data):
except MySQLdb.Error, e:
logging.debug("Unable to update database with %s, %s", data, value)
-
def progress(pgnum):
progressline = str(pgnum) + "% complete"
logging.debug("Progress: %s", pgnum)
@@ -497,6 +496,8 @@ def copy_it(install_type):
os.makedirs(mp)
except OSError:
logging.debug(" __Could not create %s", mp)
+ #copy of locale
+ cp_and_log("/usr/lib/locale/locale-archive", data_config.MOUNTPOINT+"/usr/lib/locale/locale-archive")
# General fixup
cmd = "chmod 777 %s/tmp" %(data_config.MOUNTPOINT)
runcmd(cmd)
@@ -727,6 +728,32 @@ def grub_it():
except:
logging.debug("Couldn't open grub file")
+def genlocale():
+ return
+ logging.info("Generating locales")
+ locale_list=[ "en_US ISO-8859-1", "en_US.UTF-8 UTF-8" , "de_DE.UTF-8", "da_DK.utf8", "en_DK.utf8", "it_IT.utf8", "de_DE.UTF-8"]
+ #locale_list=['UTF-8', 'en_US ISO-8859-1']
+
+ localefile="%s/etc/locale.gen" %data_config.MOUNTPOINT
+ f = open(localefile)
+ lines = f.readlines()
+ f.close()
+
+ f = open(localefile,'w')
+
+ for line in lines:
+ outline = line
+ for locale in locale_list:
+ #print locale, line
+ if locale in line:
+ outline = line.replace('#','')
+ f.write(outline)
+
+ f.close
+ #cp_and_log("/tmp/locale.gen.new", data_config.MOUNTPOINT+"/etc/locale.gen")
+ cmd = "chroot " + data_config.MOUNTPOINT +" /usr/sbin/locale-gen"
+ runcmd(cmd)
+
def fix_permissions():
logging.info("Fixing permissions")
SE = os.environ["TEMPLATES"]+"/settings/syssettings"
@@ -1009,6 +1036,7 @@ def full_install(hostoptions):
update_status(msg)
progress(98)
grub_it()
+ genlocale()
special_hardware_check()
# Configuring the system
logging.info("______Configuring system________")
@@ -1274,6 +1302,7 @@ def upgrade(hostoptions):
fstab_it("upgrade")
time.sleep(1)
grub_it()
+ genlocale()
time.sleep(1)
#needed to get around a bug with pacman
special_hardware_check()