Debian Bug report logs - #318513
xterm: 'sh -x uxterm' wrongly succeeds when 'uxterm' rightly fails

version graph

Package: xterm; Maintainer for xterm is Debian X Strike Force <debian-x@lists.debian.org>; Source for xterm is src:xterm.

Reported by: Dan Jacobson <jidanni@jidanni.org>

Date: Fri, 15 Jul 2005 23:03:02 UTC

Severity: normal

Tags: fixed-in-experimental, fixed-upstream, upstream

Found in version 4.3.0.dfsg.1-13

Fixed in version 208-1

Done: David Martínez Moreno <ender@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#318513; Package xterm. Full text and rfc822 format available.

Message #3 received at submit@bugs.debian.org (full text, mbox):

From: Dan Jacobson <jidanni@jidanni.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: needed to use sh -x /usr/X11R6/bin/uxterm
Date: Sat, 16 Jul 2005 04:48:42 +0800
Package: xterm
Version: 4.3.0.dfsg.1-13
Severity: normal
File: /usr/X11R6/bin/uxterm

Very interesting.
$ sh -x /usr/bin/X11/uxterm
gets me a uxterm, whereas
$ sh /usr/bin/X11/uxterm
just gets me error messages.
Adding -x changing the outcome of scripts? Uh oh.

Indeed, if I change the top line to #!/bin/sh -x
then it works if I call it directly.

Add a comment to the source to say what this does:
locale=`(LC_ALL=C LC_CTYPE=C LANG=C locale >/dev/null) 2>&1`
and how it is different than
locale=
and why the ().

Well, at least it enabled me to get a perfectly good uxterm, as I see
in the output
+ locale='++ LC_ALL=C
++ LC_CTYPE=C
++ LANG=C
++ locale'

whereas all I would have gotten otherwise is
$ uxterm
uxterm tried to use locale zh_TW.UTF-8
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Isn't that neat. -x debugging stuff stuffed into a variable allowing
me to get an uxterm when even this won't:

$ LC_ALL=C LC_CTYPE=C LANG=C uxterm
uxterm tried to use locale en_US.UTF-8
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

$ locale -a
C
POSIX
zh_TW
zh_TW.big5



Information forwarded to debian-bugs-dist@lists.debian.org, Debian X Strike Force <debian-x@lists.debian.org>:
Bug#318513; Package xterm. Full text and rfc822 format available.

Acknowledgement sent to Thomas Dickey <dickey@radix.net>:
Extra info received and forwarded to list. Copy sent to Debian X Strike Force <debian-x@lists.debian.org>. Full text and rfc822 format available.

Message #8 received at 318513@bugs.debian.org (full text, mbox):

From: Thomas Dickey <dickey@radix.net>
To: Dan Jacobson <jidanni@jidanni.org>, 318513@bugs.debian.org
Subject: Re: Bug#318513: needed to use sh -x /usr/X11R6/bin/uxterm
Date: Sat, 16 Jul 2005 12:05:15 -0400
[Message part 1 (text/plain, inline)]
On Sat, Jul 16, 2005 at 01:20:15AM +0200, Dan Jacobson wrote:
> Package: xterm
> Version: 4.3.0.dfsg.1-13
> Severity: normal
> File: /usr/X11R6/bin/uxterm
> 
> Very interesting.
> $ sh -x /usr/bin/X11/uxterm
> gets me a uxterm, whereas
> $ sh /usr/bin/X11/uxterm
> just gets me error messages.
> Adding -x changing the outcome of scripts? Uh oh.

As we see, it does.
 
> Indeed, if I change the top line to #!/bin/sh -x
> then it works if I call it directly.
> 
> Add a comment to the source to say what this does:
> locale=`(LC_ALL=C LC_CTYPE=C LANG=C locale >/dev/null) 2>&1`
> and how it is different than
> locale=
> and why the ().

I suppose that might help.  My rcs log says I added that line to check
if there is a working locale program.  It is only interested in seeing
if there is something written to stderr.  Now that I'm thinking about
it, something like this is what I should have done:

	locale=`sh -c "LC_ALL=C LC_CTYPE=C LANG=C locale >/dev/null" 2>&1`
 
> Well, at least it enabled me to get a perfectly good uxterm, as I see

...

> $ locale -a
> C
> POSIX
> zh_TW
> zh_TW.big5

Since you have no UTF-8 locale installed, it is not a "perfectly good"
uxterm.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
[Message part 2 (application/pgp-signature, inline)]

Changed Bug title. Request was from Branden Robinson <branden@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: upstream, fixed-upstream Request was from Branden Robinson <branden@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: pending Request was from David Martínez Moreno <ender@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: fixed-in-experimental Request was from David Martínez Moreno <ender@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to David Martínez Moreno <ender@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Dan Jacobson <jidanni@jidanni.org>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #21 received at 318513-done@bugs.debian.org (full text, mbox):

From: David Martínez Moreno <ender@debian.org>
To: 305540-done@bugs.debian.org, 311438-done@bugs.debian.org, 315195-done@bugs.debian.org, 318280-done@bugs.debian.org, 318513-done@bugs.debian.org, 324352-done@bugs.debian.org
Cc: debian-x@lists.debian.org
Subject: Closing bugs fixed in xterm 208-1.
Date: Wed, 11 Jan 2006 11:49:34 +0100
[Message part 1 (text/plain, inline)]
Version: 208-1

	David Nusinow forgot to run dpkg-buildpackage with -v option, in order to 
close bugs from previous version. All these bugs were closed by xterm 
204-0pre1 in experimental, and 208-1 in unstable.

	Best regards,


		Ender.
-- 
Another C-3PO: E chu ta!
C-3PO: How rude!
		-- C-3PO (The Empire Strikes Back).
--
Desarrollador de Debian
Debian developer
[Message part 2 (application/pgp-signature, inline)]

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 24 Jun 2007 15:36:02 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 15:36:24 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.