[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594135: patch discussion on "locales" to avoid dist-upgrade problem



Hi,

This is a continuation of discussion for squeeze release note.
http://bugs.debian.org/594135
 "please tell people to upgrade "locales" before dist-upgrade"

On Tue, Jan 04, 2011 at 01:35:47PM +0100, Julien Cristau wrote:
> On Tue, Jan  4, 2011 at 21:27:45 +0900, Osamu Aoki wrote:
...
> This bug isn't about switching to a UTF-8 locale, but about upgrading
> the 'locales' package before the rest of the system.

Thanks.

I looked into this root cause in locales package ... or eglibc-2.11.2
package to be precise.

I am now wondering why locales prerm script removes the locale-archive
file for remove situation.  It may be too early.

The attached patch to eglibc package may solve most of the problems
discussed for release-note if removed locale-archive is the cause of
problem (WARNING: untested concept only patch for discussion purpose).

=== Questions remaining ===

 * Is this the root cause?
   - Does proposed patch really fix problem?
   - If so, should we apply a patch to stable point release
     before squeeze release to avoid this issue?
   - If so, should we apply the same patch to squeeze?
 * Why there is not much bug report on this issue?
   - I can not find actual bug report case which I can use to test
     my patch.
   - There is an old wontfix for glib http://bugs.debian.org/585737

=== Detailed Situation ===

This should keep /usr/lib/locale/locale-archive for remove of locales
package to keep system usable but removes it for purge if this file is
the only thing causing problem.

This should generate /usr/lib/locale/locale-archive for remove of
locales-all package using locale-gen if available to keep system usable
if this file is the only thing causing problem. It is removed for purge
only when locales package is missing.

When new locales package is installed, it runs postinst script which in
turn runs locale-gen.

locale-gen without undocumented --keep-existing option removes all files
under /usr/lib/locale/* and this is the case here and we are safe.

As for installing locales-all package, its postinst removes
/usr/lib/locale/locale-archive before running localedef so no problem
too.

I checked BTS for this issue discussed on this thread.

* locales
  wontfix: http://bugs.debian.org/585737 : locales: upgrade not atomic

  Was this caused only because of low priority debconf problem or was
  there another solution to the problem? (Thus I CCed this report)

* postgresql
  I can not find any bug reports which seem to be relevant.

* squirrelmail
  wishlist http://bugs.debian.org/473989 : Please make utf-8 be default charset

  I am not quite sure this is directly related by reading it.

So I do not have good example case to test attached patch if it works or not.

Osamu

diff -Nru eglibc-2.11.2.orig/debian/debhelper.in/locales-all.prerm eglibc-2.11.2/debian/debhelper.in/locales-all.prerm
--- eglibc-2.11.2.orig/debian/debhelper.in/locales-all.prerm	2011-01-08 02:02:59.000000000 +0900
+++ eglibc-2.11.2/debian/debhelper.in/locales-all.prerm	2011-01-08 16:50:55.474544678 +0900
@@ -2,7 +2,14 @@
 set -e
 
 case "$1" in
-    remove|purge)
+    remove)
+	# Is locales installed?
+	if [ -x /usr/sbin/locale-gen ] ; then
+		# If yes, generate locales selected in the debconf question
+		locale-gen
+	fi
+	;;
+    purge)
 	# Is locales installed?
 	if [ -x /usr/sbin/locale-gen ] ; then
 		# If yes, generate locales selected in the debconf question
diff -Nru eglibc-2.11.2.orig/debian/debhelper.in/locales.prerm eglibc-2.11.2/debian/debhelper.in/locales.prerm
--- eglibc-2.11.2.orig/debian/debhelper.in/locales.prerm	2011-01-08 02:02:59.000000000 +0900
+++ eglibc-2.11.2/debian/debhelper.in/locales.prerm	2011-01-08 15:35:30.789767903 +0900
@@ -2,7 +2,7 @@
 set -e
 
 case "$1" in
-    remove|purge)
+    purge)
     	if ! [ -f /usr/lib/locales-all/supported.tar.lzma ] ; then
 		# If locales-all is not installed, clean the locales
 		rm -f /usr/lib/locale/locale-archive

Reply to: