r3163 - glibc-package/trunk/debian/debhelper.in
Author: aurel32
Date: 2008-10-13 13:47:26 +0000 (Mon, 13 Oct 2008)
New Revision: 3163
Modified:
glibc-package/trunk/debian/debhelper.in/locales.postinst
Log:
Minor fixes to locales.postinst
Modified: glibc-package/trunk/debian/debhelper.in/locales.postinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/locales.postinst 2008-10-13 10:16:22 UTC (rev 3162)
+++ glibc-package/trunk/debian/debhelper.in/locales.postinst 2008-10-13 13:47:26 UTC (rev 3163)
@@ -14,8 +14,6 @@
. /usr/share/debconf/confmodule
db_version 2.0
- SUPPORTED_LOCALES="$(sed -e '/^[a-zA-Z]/!d' -e 's/ *$//g' /usr/share/i18n/SUPPORTED /usr/local/share/i18n/SUPPORTED 2>/dev/null | sort -u)"
-
db_get locales/default_environment_locale && DEFAULT_ENVIRONMENT="$RET"
db_get locales/locales_to_be_generated && SELECTED_LOCALES=$RET
SELECTED_LOCALES="$(echo $SELECTED_LOCALES | sed -e 's/, /\n/g')"
@@ -37,18 +35,25 @@
fi
# Comment previous defined locales
- sed -i -e 's/^[a-zA-Z]/# &/' $LG
+ sed -i -e 's/^ *[a-zA-Z]/# &/' $LG
+ # Get list of supported locales
+ if [ -f "/usr/local/share/i18n/SUPPORTED" ] ; then
+ SUPPORTED_LOCALES="$(sed -e '/^[a-zA-Z]/!d' -e 's/ *$//g' /usr/share/i18n/SUPPORTED /usr/local/share/i18n/SUPPORTED | sort -u)"
+ else
+ SUPPORTED_LOCALES="$(sed -e '/^[a-zA-Z]/!d' -e 's/ *$//g' /usr/share/i18n/SUPPORTED | sort -u)"
+ fi
+
# Make sure all locales exist in locales.gen
echo "$SUPPORTED_LOCALES" | while read locale ; do
- if ! grep -q "^# *$locale *\$" $LG; then
+ if ! grep -q "^[# ]*$locale *\$" $LG; then
echo "# $locale" >> $LG
fi
done
# Uncomment selected locales
echo "$SELECTED_LOCALES" | while read locale ; do
- sed -i -e "s/# *$locale *$/$locale/" $LG
+ sed -i -e "s/^[# ]*$locale *$/$locale/" $LG
done
fi
Reply to: