Bug#425117: E: locale::facet::_S_create_c_locale name not valid

2007-05-19 Thread Martin Michlmayr
Package: schroot
Version: 1.0.5-1

I'm getting the following error when starting schroot:

  13:[EMAIL PROTECTED]: ~] schroot
  E: locale::facet::_S_create_c_locale name not valid

The reason is that I have LANG=en_US.UTF-8 but this locale wasn't
generated.  After generating this locale file, schroot started to
work, but I think it should also work without having the locale
installed.
-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#425117: [Buildd-tools-devel] Bug#425117: E: locale::facet::_S_create_c_locale name not valid

2007-05-19 Thread Roger Leigh
tags 425117 + confirmed
thanks

Martin Michlmayr [EMAIL PROTECTED] writes:

 Package: schroot
 Version: 1.0.5-1

 I'm getting the following error when starting schroot:

   13:[EMAIL PROTECTED]: ~] schroot
   E: locale::facet::_S_create_c_locale name not valid

 The reason is that I have LANG=en_US.UTF-8 but this locale wasn't
 generated.  After generating this locale file, schroot started to
 work, but I think it should also work without having the locale
 installed.

Agreed.  This is however occuring inside libstdc++ during
initialisation of the locale.  I'll need to try to specifically catch
that exception and then try to fall back to a C locale in that case.

Unfortunately, I'm now waiting on #424038 in order to be able to
build...


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


pgpXqZefo3oaA.pgp
Description: PGP signature


Bug#425117: [Buildd-tools-devel] Bug#425117: E: locale::facet::_S_create_c_locale name not valid

2007-05-19 Thread Roger Leigh
tags 425117 + patch
thanks

Martin Michlmayr [EMAIL PROTECTED] writes:

 Package: schroot
 Version: 1.0.5-1

 I'm getting the following error when starting schroot:

   13:[EMAIL PROTECTED]: ~] schroot
   E: locale::facet::_S_create_c_locale name not valid

 The reason is that I have LANG=en_US.UTF-8 but this locale wasn't
 generated.  After generating this locale file, schroot started to
 work, but I think it should also work without having the locale
 installed.

Does the attached patch fix things for you?

Note, you'll need to run ./bootstrap due to #424038 if you are using
current unstable.


Thanks,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: sbuild/sbuild-basic-keyfile.tcc
===
--- sbuild/sbuild-basic-keyfile.tcc	(revision 1173)
+++ sbuild/sbuild-basic-keyfile.tcc	(working copy)
@@ -179,7 +179,15 @@
 			  key_type const key,
 			  std::string   value) const
 {
-  std::string localename = std::locale().name();
+  std::string localename;
+  try
+{
+  localename = std::locale().name();
+}
+  catch (std::runtime_error const e) // Invalid locale
+{
+  localename = std::locale::classic();
+}
   std::string::size_type pos;
   bool status = false;
 
Index: configure.ac
===
--- configure.ac	(revision 1173)
+++ configure.ac	(working copy)
@@ -222,20 +222,20 @@
  [AC_MSG_FAILURE([liblockdev (lockdev) is not installed, but is required by schroot])])
 AC_SUBST([LOCKDEV_LIBS])
 
-AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options])
+AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options-st])
 saved_ldflags=${LDFLAGS}
-LDFLAGS=${LDFLAGS} -lboost_program_options
+LDFLAGS=${LDFLAGS} -lboost_program_options-st
 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include boost/program_options.hpp],
[boost::program_options::variables_map::variables_map dummy()])],
[AC_MSG_RESULT([yes])
-	BOOST_LIBS=${BOOST_LIBS} -lboost_program_options],
+	BOOST_LIBS=${BOOST_LIBS} -lboost_program_options-st],
[AC_MSG_RESULT([no])
 	AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
 LDFLAGS=${saved_ldflags}
 
-AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options])
+AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options-st])
 saved_ldflags=${LDFLAGS}
-LDFLAGS=${LDFLAGS} -lboost_program_options
+LDFLAGS=${LDFLAGS} -lboost_program_options-st
 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include boost/program_options.hpp],
[boost::program_options::options_description testgrp(test group);
 bool notused = testgrp.options().empty();
@@ -250,13 +250,13 @@
   AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
 fi
 
-AC_MSG_CHECKING([for boost::regex in -lboost_regex])
+AC_MSG_CHECKING([for boost::regex in -lboost_regex-st])
 saved_ldflags=${LDFLAGS}
-LDFLAGS=${LDFLAGS} -lboost_regex
+LDFLAGS=${LDFLAGS} -lboost_regex-st
 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include boost/regex.hpp],
[boost::regex(^foo[bar]$)])],
[AC_MSG_RESULT([yes])
-	BOOST_LIBS=${BOOST_LIBS} -lboost_regex],
+	BOOST_LIBS=${BOOST_LIBS} -lboost_regex-st],
[AC_MSG_RESULT([no])
 	AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])
 LDFLAGS=${saved_ldflags}
Index: bin/schroot-base/schroot-base-run.h
===
--- bin/schroot-base/schroot-base-run.h	(revision 1173)
+++ bin/schroot-base/schroot-base-run.h	(working copy)
@@ -51,7 +51,14 @@
 try
   {
 	// Set up locale.
-	std::locale::global(std::locale());
+	try
+	  {
+	std::locale::global(std::locale());
+	  }
+	catch (std::runtime_error const e) // Invalid locale
+	  {
+	std::locale::global(std::locale::classic());
+	  }
 	std::cout.imbue(std::locale());
 	std::cerr.imbue(std::locale());
 


pgpZVzAMcudlv.pgp
Description: PGP signature


Bug#425117: [Buildd-tools-devel] Bug#425117: E: locale::facet::_S_create_c_locale name not valid

2007-05-19 Thread Martin Michlmayr
* Roger Leigh [EMAIL PROTECTED] [2007-05-19 16:47]:
 Does the attached patch fix things for you?

I cannot easily recompile schroot right now.  I'll just trust you that
it works. :)
-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#425117: [Buildd-tools-devel] Bug#425117: Bug#425117: E: locale::facet::_S_create_c_locale name not valid

2007-05-19 Thread Roger Leigh
tags 425117 + fixed-upstream pending
thanks

Martin Michlmayr [EMAIL PROTECTED] writes:

 * Roger Leigh [EMAIL PROTECTED] [2007-05-19 16:47]:
 Does the attached patch fix things for you?

 I cannot easily recompile schroot right now.  I'll just trust you that
 it works. :)

OK :)


-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


pgppLL3EVbp6L.pgp
Description: PGP signature