Bug#219765: Languagechooser 1.03 dies on mipsel
Karsten Merker wrote: 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 +, 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. Thanks for the explanation. Would you please file a bug against the shell and add a comment referencing it and indicating that the workaround should be removed once the bug is fixed? -- Matt - This message was sent using the LA Free-Net - LA's best kept secret. http://www.lafn.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#219765: Languagechooser 1.03 dies on mipsel
On Tue, Nov 11, 2003 at 10:25:31PM +0100, Karsten Merker wrote: 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. It's not a crash or a segfault or anything like that; the shell is 'set -e' and therefore exits at the first command which returns a non-zero exit status. The old code was certainly wrong, but the new code ought to work, as the shell is not supposed to exit under -e when the command returning non-zero is guarded by an 'if'. It would seem that the shell doesn't handle pipelines in if statements properly under -e. Pending a fix to the shell, I would suggest surrounding the 'if' block with 'set +e' and 'set -e', which ought to fix the problem but makes it more obvious that it's there exactly and only to work around a shell bug. Cheers, -- Colin Watson [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#219765: Languagechooser 1.03 dies on mipsel
Karsten Merker wrote: 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 Interestingly, this variant does not cause languagechooser to crash. JoeyH, is it ok if I check this one-liner into the CVS? It makes d-i on mipsel (at least partially, see below) usable and should not have any negative impact on other architectures. Of course it's fine. If I were you I would try to narrow it down to a test case that can run on busybox ash and file a bug on busybox-cvs as well, since it seems it must be rather broken on your architecture. -- see shy jo signature.asc Description: Digital signature
Bug#219765: Languagechooser 1.03 dies on mipsel
On Mon, Nov 10, 2003 at 10:26:20PM +0100, Karsten Merker wrote: On Sat, Nov 08, 2003 at 09:38:09PM +, 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? -- Matt -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#219765: Languagechooser 1.03 dies on mipsel
On Sat, 2003-11-08 at 20:48, Karsten Merker wrote: Package: languagechooser Version: 1.03 and 1.04-cvs On mipsel, languagechooser dies with a return-code of 1 when called from main-menu (probably it segfaults). When called in a shell via udpkg --configure language-chooser it just hangs. Further tests have narrowed down the problem to the following code segment: # Only display the translated texts (ie the English translation) # when in UTF-8 mode. 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 ... Could you please test this on mipsel? I can't log into a mipsel box at the moment. if this fails, try the variant if `echo $LANG $LC_CTYPE | grep -q UTF-8 ` ; then ... Regards, Alastair McKinstry The echo and grep processes are started, but the db_set is not called. When the same sequence is run manually in a shell, it works as expected. Exchanging the busybox-ash by a dash as /bin/sh does not change the behaviour. If the sequence above is removed and replaced by a single db_set debconf/language C as a temporary workaround, language-chooser works on mipsel. 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. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]