Bug#271526: Problem with locale.gen during updating package locales
tags 271526 = patch
thanks
On Sun, Jan 09, 2005 at 11:21:48PM +0100, Georg Philipp Burth wrote:
> Package: locales
> Version: 2.3.2.ds1-20
> Followup-For: Bug #271526
>
>
> When I updated my sarge system today it also wanted to update the
> locales. But during installation it seemed to have some sort of infinite
> loop generating de_DE@euro in ISO-8859-15, so I aborted it with Ctrl-C
> (all of the installations) and checked the debian bug reports for this.
You are right; if for any reason (it seems that localeconf may cause
such duplicates, but this can also occur if user manually edit this file)
a locale is defined twice in /etc/locale.gen, this locale will be
duplicated more and more in this file each time locales postinst is run.
Here is a patch.
Denis
Index: locales.postinst
===================================================================
RCS file: /cvs/glibc/glibc-package/debian/debhelper.in/locales.postinst,v
retrieving revision 1.2
diff -u -r1.2 locales.postinst
--- locales.postinst 28 Oct 2003 23:07:30 -0000 1.2
+++ locales.postinst 17 Mar 2005 00:00:57 -0000
@@ -33,7 +33,10 @@
save_IFS=$IFS
IFS=,
for locale in $list; do
- if grep -q "^#$locale *\$" $LG; then
+ if grep -q "^$locale *\$" $LG; then
+ # This locale has already been inserted, do nothing
+ :
+ elif grep -q "^#$locale *\$" $LG; then
# Uncomment previous defined locales
sed -e "s,#$locale *\$,$locale," $LG > $LG.tmp || true
mv -f $LG.tmp $LG
Reply to: