r2719 - in glibc-package/trunk/debian: . debhelper.in local/usr_sbin rules.d
Author: aurel32
Date: 2007-11-29 17:02:57 +0000 (Thu, 29 Nov 2007)
New Revision: 2719
Added:
glibc-package/trunk/debian/debhelper.in/locales.README
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/debhelper.in/locales.NEWS
glibc-package/trunk/debian/debhelper.in/locales.config
glibc-package/trunk/debian/debhelper.in/locales.postinst
glibc-package/trunk/debian/local/usr_sbin/locale-gen
glibc-package/trunk/debian/rules.d/debhelper.mk
Log:
* support user defined locales in /usr/local/share/i18n. Closes: #453131.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2007-11-29 10:26:22 UTC (rev 2718)
+++ glibc-package/trunk/debian/changelog 2007-11-29 17:02:57 UTC (rev 2719)
@@ -22,8 +22,9 @@
* debian/debhelper.in/locales-all.postinst: honor TMPDIR. Closes: #453326.
* patches/any/submitted-malloc_h.diff: defines __need_ptrdiff_t,
__need_size_t and __need_NULL in malloc.h. Closes: #453264.
+ * support user defined locales in /usr/local/share/i18n. Closes: #453131.
- -- Aurelien Jarno <aurel32@debian.org> Thu, 29 Nov 2007 00:00:08 +0100
+ -- Aurelien Jarno <aurel32@debian.org> Thu, 29 Nov 2007 18:01:03 +0100
glibc (2.7-2) unstable; urgency=low
Modified: glibc-package/trunk/debian/debhelper.in/locales.NEWS
===================================================================
--- glibc-package/trunk/debian/debhelper.in/locales.NEWS 2007-11-29 10:26:22 UTC (rev 2718)
+++ glibc-package/trunk/debian/debhelper.in/locales.NEWS 2007-11-29 17:02:57 UTC (rev 2719)
@@ -1,3 +1,11 @@
+locales (2.7-3) unstable; urgency=low
+
+ * Starting with locales 2.7-3, users can provide their own locales in
+ /usr/local/share/i18n. See /usr/share/locales/README.Debian for
+ more information.
+
+ -- Aurelien Jarno <aurel32@debian.org> Thu 29 Nov 2007 18:54:12 +0100
+
locales (2.7-1) unstable; urgency=low
* Starting with locales 2.7-1 the deprecated no_NO locale has been
Added: glibc-package/trunk/debian/debhelper.in/locales.README
===================================================================
--- glibc-package/trunk/debian/debhelper.in/locales.README (rev 0)
+++ glibc-package/trunk/debian/debhelper.in/locales.README 2007-11-29 17:02:57 UTC (rev 2719)
@@ -0,0 +1,17 @@
+locales
+-------
+
+ * Starting with locales 2.7-3, users can provide their own locales in
+ addition to the ones provided by the package. They will be handled
+ as other locales in the various scripts.
+
+ Each user defined locale has to be provided as a single file and
+ placed in the /usr/local/share/i18n/locales/ directory. The list of
+ user defined locales should be placed, one by line, in the file
+ /usr/local/share/i18n/SUPPORTED. You can have a look to the locales
+ provided by the locales package in /usr/share/i18n/ for more details.
+
+ To enable the new locales, just run 'dpkg-reconfigure locales' and
+ select the new locales.
+
+ -- Aurelien Jarno <aurel32@debian.org> Thu 29 Nov 2007 18:54:12 +0100
Modified: glibc-package/trunk/debian/debhelper.in/locales.config
===================================================================
--- glibc-package/trunk/debian/debhelper.in/locales.config 2007-11-29 10:26:22 UTC (rev 2718)
+++ glibc-package/trunk/debian/debhelper.in/locales.config 2007-11-29 17:02:57 UTC (rev 2719)
@@ -5,9 +5,17 @@
db_version 2.0
db_capb backup multiselect
-# List of locales supported by the current version
-SUPPORTED_LOCALES="__SUPPORTED_LOCALES__"
+# List of locales provided by the current version
+PROVIDED_LOCALES="__PROVIDED_LOCALES__"
+# List of locales provided by the user
+if [ -f /usr/local/share/i18n/SUPPORTED ] ; then
+ USER_LOCALES="$(sed -e 's/#.*//g' /usr/local/share/i18n/SUPPORTED)"
+fi
+
+# List of supported locales
+SUPPORTED_LOCALES=$(echo "$PROVIDED_LOCALES$USER_LOCALES" | sed -e 's/^ *//g' -e 's/ *$//g' | sort -u | tr '\n' ',' | sed -e 's/, */, /g' -e 's/, *$//g')
+
# Get the list of selected locales from /etc/locale.gen
SELECTED_LOCALES=
if [ -L /etc/locale.gen ] && [ "$(readlink /etc/locale.gen)" = /usr/share/i18n/SUPPORTED ]; then
Modified: glibc-package/trunk/debian/debhelper.in/locales.postinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/locales.postinst 2007-11-29 10:26:22 UTC (rev 2718)
+++ glibc-package/trunk/debian/debhelper.in/locales.postinst 2007-11-29 17:02:57 UTC (rev 2719)
@@ -4,9 +4,18 @@
LG="/etc/locale.gen"
EE="/etc/default/locale"
-# List of locales supported by the current version
-SUPPORTED_LOCALES="__SUPPORTED_LOCALES__"
+# List of locales provided by the current version
+PROVIDED_LOCALES="__PROVIDED_LOCALES__"
+# List of locales provided by the user
+if [ -f /usr/local/share/i18n/SUPPORTED ] ; then
+ USER_LOCALES="$(sed -e 's/#.*//g' /usr/local/share/i18n/SUPPORTED)"
+fi
+
+# List of supported locales
+SUPPORTED_LOCALES=$(echo "$PROVIDED_LOCALES$USER_LOCALES" | sed -e 's/^ *//g' -e 's/ *$//g' | sort -u | tr '\n' ',' | sed -e 's/, */, /g' -e 's/, *$//g')
+
+
if [ "$1" = configure ]; then
. /usr/share/debconf/confmodule
@@ -21,8 +30,8 @@
else
cat > $LG << EOF
# This file lists locales that you wish to have built. You can find a list
-# of valid supported locales at /usr/share/i18n/SUPPORTED. Other
-# combinations are possible, but may not be well tested. If you change
+# of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add
+# user defined locales to /usr/locale/share/i18n/SUPPORTED. If you change
# this file, you need to rerun locale-gen.
#
Modified: glibc-package/trunk/debian/local/usr_sbin/locale-gen
===================================================================
--- glibc-package/trunk/debian/local/usr_sbin/locale-gen 2007-11-29 10:26:22 UTC (rev 2718)
+++ glibc-package/trunk/debian/local/usr_sbin/locale-gen 2007-11-29 17:02:57 UTC (rev 2719)
@@ -4,6 +4,7 @@
LOCALEGEN=/etc/locale.gen
LOCALES=/usr/share/i18n/locales
+USER_LOCALES=/usr/local/share/i18n/locales
if [ -n "$POSIXLY_CORRECT" ]; then
unset POSIXLY_CORRECT
fi
@@ -46,8 +47,16 @@
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; \
+ if [ -f $USER_LOCALES/$locale ] ; then
+ input=$USER_LOCALES/$locale
+ elif [ -f $LOCALES/$locale ]; then
+ input=$locale
+ else
+ input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`
+ if [ -f $USER_LOCALES/$input ]; then
+ input=$USER_LOCALES/$input
+ fi
+ fi
localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale || :; \
echo ' done'; \
done < $LOCALEGEN
Modified: glibc-package/trunk/debian/rules.d/debhelper.mk
===================================================================
--- glibc-package/trunk/debian/rules.d/debhelper.mk 2007-11-29 10:26:22 UTC (rev 2718)
+++ glibc-package/trunk/debian/rules.d/debhelper.mk 2007-11-29 17:02:57 UTC (rev 2719)
@@ -224,9 +224,8 @@
done ; \
done
- # Substitute __SUPPORTED_LOCALES__.
- SUPPORTED_LOCALES=$$(cat debian/tmp-libc/usr/share/i18n/SUPPORTED | tr '\n' ',' | sed -e 's/,/, /g' -e 's/, *$$//') ; \
- sed -i -e "s/__SUPPORTED_LOCALES__/$$SUPPORTED_LOCALES/" debian/locales.config debian/locales.postinst
+ # Substitute __PROVIDED_LOCALES__.
+ perl -i -pe 'BEGIN {undef $$/; open(IN, "debian/tmp-libc/usr/share/i18n/SUPPORTED"); $$j=<IN>;} s/__PROVIDED_LOCALES__/$$j/g;' debian/locales.config debian/locales.postinst
# Generate common substvars files.
echo "locale:Depends=$(shell perl debian/debver2localesdep.pl $(LOCALES_DEP_VER))" > tmp.substvars
@@ -262,5 +261,6 @@
rm -f debian/*.lintian
rm -f debian/*.linda
rm -f debian/*.NEWS
+ rm -f debian/*.README
rm -f $(stamp)binaryinst*
Reply to: