Bug#594135: patch discussion on "locales" to avoid dist-upgrade problem
This is a continuation of discussion for squeeze release note.
"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.
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
- 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
I checked BTS for this issue discussed on this thread.
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)
I can not find any bug reports which seem to be relevant.
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.
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 @@
case "$1" in
+ # Is locales installed?
+ if [ -x /usr/sbin/locale-gen ] ; then
+ # If yes, generate locales selected in the debconf question
# 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 @@
case "$1" in
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