Commit 424373cb authored by Anton Midyukov's avatar Anton Midyukov

cleanup: refactoring live/image-scripts.d/80-locales

parent 49a33ad8
#!/bin/sh
# FIXME: there should be less brutal i18n tuning
# don't cripple the image to be copied over
[ -n "$GLOBAL_LIVE_INSTALL"] || \
[ -x /usr/sbin/live-install ] || \
[ -x /usr/sbin/livecd-install ] && exit 0
[ -z "$GLOBAL_LIVE_INSTALL" ] || exit 0
[ ! -x /usr/sbin/live-install ] || exit 0
[ ! -x /usr/sbin/livecd-install ] || exit 0
if [ -n "$GLOBAL_LOCALES" ]; then
# -not -name C* -a -not -name en* -a -not -name ru*
LOCALES="$(echo "C*" $GLOBAL_LOCALES | sed 's/ / -a -not -name /g;s/^/-not -name /;s/_[A-Z]*/*/g')"
else
LOCALES="-not -name C*"
fi
find /usr/share/locale /usr/lib/locale -mindepth 1 -maxdepth 1 \
$LOCALES -exec rm -r {} \;
cd /usr/share/locale
rm -r *@*
for i in */; do
case "$i" in
be*|en*|ru*|uk*) continue;;
esac
rm -r "$i"
done
:
......@@ -18,8 +18,8 @@ if [ -f "$langlist" ] && [ -n "$locales" ]; then
fi
if [ -n "$locale" ]; then
which localectl 2>&1 >/dev/null && echo LANG="$locale".UTF8 > "$systemd_locale"
[ -f "$sysv_locale" ] && echo LANG="$locale".UTF8 > "$sysv_locale"
[ -f "$sysv_locale" ] && echo SUPPORTED="$locale".UTF8 >> "$sysv_locale"
which localectl 2>&1 >/dev/null && echo LANG="$locale".UTF-8 > "$systemd_locale"
[ -f "$sysv_locale" ] && echo LANG="$locale".UTF-8 > "$sysv_locale"
[ -f "$sysv_locale" ] && echo SUPPORTED="$locale".UTF-8 >> "$sysv_locale"
fi
:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment