Re: Bug#605790: manconv: lot's of locale warnings during upgrade from lenny to squeeze
On Sat, Dec 04, 2010 at 04:54:46PM +0000, Adam D. Barratt wrote:
> On Sat, 2010-12-04 at 15:41 +0100, Michael Biebl wrote:
> > On 04.12.2010 14:40, Colin Watson wrote:
> > > There's only a limited amount I can do about this, because I'm fairly
> > > sure that lenny's version of man-db is still running at this point.
> > > man-db >= 2.5.3 normally calls manconv as an internal function rather
> > > than by executing an external program, so you'd only get a single
> > > warning per call to mandb with squeeze's version.
> > >
> > > I can backport a change from man-db 2.5.8 to at least arrange for this
> > > not to happen on squeeze->wheezy upgrades, though, and maybe decrease
> > > the incidence of it on lenny->squeeze upgrades.
> >
> > Maybe the (stable) release team would ack a stable upload with a fix for this?
>
> I'd have to see the diff for a final ack, but with both relevant hats on
> I'm in favour of having this resolved (at least so far as feasible).
OK. How about this?
diff -u man-db-2.5.2/debian/changelog man-db-2.5.2/debian/changelog
--- man-db-2.5.2/debian/changelog
+++ man-db-2.5.2/debian/changelog
@@ -1,3 +1,14 @@
+man-db (2.5.2-5) stable; urgency=low
+
+ * Backport from 2.5.8:
+ - Warnings about unrecognised locales are now suppressed if the
+ DPKG_RUNNING_VERSION environment variable is set (i.e. man-db is
+ running within a Debian package's maintainer script), since the system
+ locales are often out of sync with the C library in that context.
+ Thanks to the Debian Perl maintainers for the idea (closes: #605790).
+
+ -- Colin Watson <cjwatson@debian.org> Sat, 04 Dec 2010 17:53:21 +0000
+
man-db (2.5.2-4) unstable; urgency=low
* Backport from trunk:
diff -u man-db-2.5.2/src/manconv.c man-db-2.5.2/src/manconv.c
--- man-db-2.5.2/src/manconv.c
+++ man-db-2.5.2/src/manconv.c
@@ -347,7 +347,7 @@
program_name = base_name (argv[0]);
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/lexgrog_test.c
+++ man-db-2.5.2/src/lexgrog_test.c
@@ -133,7 +133,7 @@
program_name = base_name (argv[0]);
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/globbing_test.c
+++ man-db-2.5.2/src/globbing_test.c
@@ -98,7 +98,7 @@
program_name = base_name (argv[0]);
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/zsoelim.c
+++ man-db-2.5.2/src/zsoelim.c
@@ -2365,7 +2365,7 @@
program_name = base_name (argv[0]);
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/manpath.c
+++ man-db-2.5.2/src/manpath.c
@@ -112,7 +112,7 @@
program_name = base_name (argv[0]);
/* initialise the locale */
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/catman.c
+++ man-db-2.5.2/src/catman.c
@@ -414,9 +414,10 @@
/* initialise the locale */
locale = xstrdup (setlocale (LC_ALL, ""));
if (!locale) {
- /* Obviously can't translate this. */
- error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
- "are correct");
+ if (!getenv ("DPKG_RUNNING_VERSION"))
+ /* Obviously can't translate this. */
+ error (0, 0, "can't set the locale; make sure $LC_* "
+ "and $LANG are correct");
locale = xstrdup ("C");
}
bindtextdomain (PACKAGE, LOCALEDIR);
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/man.c
+++ man-db-2.5.2/src/man.c
@@ -826,7 +826,7 @@
umask (022);
/* initialise the locale */
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/accessdb.c
+++ man-db-2.5.2/src/accessdb.c
@@ -109,7 +109,7 @@
program_name = base_name (argv[0]);
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/zsoelim.l
+++ man-db-2.5.2/src/zsoelim.l
@@ -359,7 +359,7 @@
program_name = base_name (argv[0]);
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/mandb.c
+++ man-db-2.5.2/src/mandb.c
@@ -544,7 +544,7 @@
program_name = base_name (argv[0]);
/* initialise the locale */
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
only in patch2:
unchanged:
--- man-db-2.5.2.orig/src/whatis.c
+++ man-db-2.5.2/src/whatis.c
@@ -724,7 +724,7 @@
}
/* initialise the locale */
- if (!setlocale (LC_ALL, ""))
+ if (!setlocale (LC_ALL, "") && !getenv ("DPKG_RUNNING_VERSION"))
/* Obviously can't translate this. */
error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
"are correct");
--
Colin Watson [cjwatson@debian.org]
Reply to: