diff options
author | James Meyer <james.meyer@operamail.com> | 2010-12-02 22:37:23 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2010-12-02 22:37:34 (GMT) |
commit | 8b94d7f39c71234712bead363526a0283efeb9fa (patch) | |
tree | 23f1dbd6458dc39a2c1b08bcdd4cbf768a60d84d /build_tools/larch8/larch0/buildscripts/larch-locales | |
parent | 338af567e74d08cbd357079941208e494463d61e (diff) | |
download | linhes_dev-8b94d7f39c71234712bead363526a0283efeb9fa.zip |
larch8: first checkin, still needs some work
Diffstat (limited to 'build_tools/larch8/larch0/buildscripts/larch-locales')
-rwxr-xr-x | build_tools/larch8/larch0/buildscripts/larch-locales | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/build_tools/larch8/larch0/buildscripts/larch-locales b/build_tools/larch8/larch0/buildscripts/larch-locales new file mode 100755 index 0000000..254e037 --- /dev/null +++ b/build_tools/larch8/larch0/buildscripts/larch-locales @@ -0,0 +1,45 @@ +#!/bin/bash +# +# larch-locales - Generate glibc locales to an overlay (a slightly tricky business) +# +#2009.08.26 + +# If there is a 'locale.gen' file in the profile (rootoverlay/etc/locale.gen) +# it will be used for the generation, otherwise the existing '/etc/locale.gen' +# (in the system to be larchified!) will be used, which is empty by default. + +# $1: path to system to be larchified ("" if running system) +# $2: path to temporary overlay directory (where the overlay is being built) + +INSTLDIR="$1" +OVERLAYDIR="$2" + +mkdir -p ${OVERLAYDIR}/usr/lib +echo +echo "********** Generating locales to an overlay **********" +echo +rm -f ${INSTLDIR}/etc/locale.gen_new +rm -rf ${INSTLDIR}/usr/lib/locale.save +if [ -f ${OVERLAYDIR}/etc/locale.gen ]; then + mv -f ${INSTLDIR}/etc/locale.gen ${INSTLDIR}/etc/locale.gen_old + cp ${OVERLAYDIR}/etc/locale.gen ${INSTLDIR}/etc + cp -a ${INSTLDIR}/usr/lib/locale ${INSTLDIR}/usr/lib/locale.save +fi + +if [ -n "${INSTLDIR}" ]; then + chroot ${INSTLDIR} /usr/sbin/locale-gen +else + /usr/sbin/locale-gen +fi + +rm -rf ${OVERLAYDIR}/usr/lib/locale +cp -a ${INSTLDIR}/usr/lib/locale ${OVERLAYDIR}/usr/lib +# /usr/lib/locale will be excluded from system.sqf + +# Restore old locale files +if [ -f ${INSTLDIR}/etc/locale.gen_old ]; then + mv -f ${INSTLDIR}/etc/locale.gen_old ${INSTLDIR}/etc/locale.gen + rm -rf ${INSTLDIR}/usr/lib/locale + mv ${INSTLDIR}/usr/lib/locale.save ${INSTLDIR}/usr/lib/locale +fi + |