added a parallel local-gen script to be able to build the locales correctly

This commit is contained in:
AlmAck 2014-05-04 22:58:33 +02:00
parent 0a1b0c22d5
commit 6c96dea47b
3 changed files with 56 additions and 2 deletions

View File

@ -12,8 +12,11 @@ arch=('x86_64')
url="http://www.chakraos.org/"
license=('GPL')
source=("skel.tar.gz")
source=("$pkgname"::"git://gitorious.org/chakra/${_gitname}.git#commit=${_gitsha}")
md5sums=('SKIP')
source=("$pkgname"::"git://gitorious.org/chakra/${_gitname}.git#commit=${_gitsha}"
'locale-gen-fixme')
install=chakra-live-skel.install
md5sums=('SKIP'
'476e9113489f93b348b21e144b6a8fcf')
package() {
cd ${srcdir}/${pkgname}/chakra-live-packages/chakra-live-skel/skel
@ -21,4 +24,8 @@ package() {
cp -a $folder ${pkgdir}; \
done
chmod 750 ${pkgdir}/etc/sudoers.d/
# copy the parallel version of locale-gen
install -dm755 ${pkgdir}/usr/sbin
install -m755 ${srcdir}/locale-gen-fixme ${pkgdir}/usr/sbin
}

View File

@ -0,0 +1,5 @@
post_install() {
ldconfig -r .
locale-gen-fixme
}

View File

@ -0,0 +1,42 @@
#!/bin/sh
set -e
LOCALEGEN=/etc/locale.gen
LOCALES=/usr/share/i18n/locales
if [ -n "$POSIXLY_CORRECT" ]; then
unset POSIXLY_CORRECT
fi
[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
# Remove all old locale dir and locale-archive before generating new
# locale data.
rm -rf /usr/lib/locale/* || true
umask 022
is_entry_ok() {
if [ -n "$locale" -a -n "$charset" ] ; then
true
else
echo "error: Bad entry '$locale $charset'"
false
fi
}
echo "Generating locales..."
while read locale charset; do \
case $locale in \#*) continue;; "") continue;; esac; \
is_entry_ok || continue
echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
echo -n ".$charset"; \
echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
echo -n '...'; \
if [ -f $LOCALES/$locale ]; then input=$locale; else \
input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \
echo ' done'; \
done < $LOCALEGEN
echo "Generation complete."