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

Bug#219765: Languagechooser 1.03 dies on mipsel



On Mon, Nov 10, 2003 at 07:02:30PM -0800, Matt Kraai wrote:
> On Mon, Nov 10, 2003 at 10:26:20PM +0100, Karsten Merker wrote:
> > On Sat, Nov 08, 2003 at 09:38:09PM +0000, Alastair McKinstry wrote:
> > 
> > > > if echo $LANG $LC_CTYPE | grep -q UTF-8 ; then
> > > >   db_set debconf/language en
> > > > else
> > > >   db_set debconf/language C
> > > > fi
> > > 
> > > Hi,
> > > 
> > > The code actually goes:
> > > echo $LANG $LC_CTYPE | grep -q UTF-8
> > > if [ $? ] ; then
> > > ...
> > 
> > That was the original case, which also did not work. The code I cited
> > above is the current state in cvs.
> > 
> > > if this fails, try the variant
> > > if `echo $LANG $LC_CTYPE | grep -q UTF-8 ` ; then
> 
> What are the backticks for?

They have no "real" function, in fact they are logically "wrong" here,
but they cause the shell to take an additional redirection which does
not trigger the shell crash that happens without them.

This contruction works only "by accident" because grep is called with
the -q option, so that the backticks end up in delivering an empty
string. Nonetheless the grep gets evaluated and the if executes the
following code based on the returncode of the grep.

In the meantime I have tried making this a "legal" contruct that also
does not trigger the crash. If one executes the "echo $LANG $LC_CTYPE |
grep -q UTF-8" in a subshell, it also does not crash, so the proper
solution would probably be to write

if (echo $LANG $LC_CTYPE | grep -q UTF-8 ) ; then

This works for me without crashing, and as the return code is passed
back from the subshell, the code does what it is supposed to do, i.e.
set debconf/language to "en" in case of an UTF-8 locale and to "C"
otherwise.

If nobody objects, I will check this into the CVS.

We still have to look into the other problem I have mentioned (d-i
hanging after selecting another language than US-English), though.

Regards,
Karsten
-- 
#include <standard_disclaimer>
Nach Paragraph 28 Abs. 3 Bundesdatenschutzgesetz widerspreche ich der Nutzung
oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder
Meinungsforschung.



Reply to: