mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 10:17:14 +08:00
added a parallel local-gen script to be able to build the locales correctly
This commit is contained in:
parent
0a1b0c22d5
commit
6c96dea47b
@ -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
|
||||
}
|
||||
|
5
chakra-live-skel/chakra-live-skel.install
Normal file
5
chakra-live-skel/chakra-live-skel.install
Normal file
@ -0,0 +1,5 @@
|
||||
post_install() {
|
||||
ldconfig -r .
|
||||
|
||||
locale-gen-fixme
|
||||
}
|
42
chakra-live-skel/locale-gen-fixme
Normal file
42
chakra-live-skel/locale-gen-fixme
Normal 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."
|
Loading…
Reference in New Issue
Block a user