[Patch] trap: exit: invalid signal specification

STALE3711d

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

[Patch] trap: exit: invalid signal specification

From: S.Çağlar Onur <hidden>
Date: 2016-06-15 22:42:30

Hi;

This tiny patch is needed to solve

caglar@zangetsu ~ $ git-clone 
/usr/bin/git-clone: line 121: trap: exit: invalid signal specification

error under tr_TR.UTF-8 (and other Turkic locales). For these locales 
upper(i) != I .

P.S: If needed please CC me, i'm not subscribed to list

Signed-off-by: S.Çağlar Onur <redacted>
---

diff -ur git-1.4.0.orig/git-clone.sh git-1.4.0/git-clone.sh
--- git-1.4.0.orig/git-clone.sh 2006-06-10 22:41:54.000000000 +0300
+++ git-1.4.0/git-clone.sh      2006-06-24 03:54:49.000000000 +0300
@@ -205,7 +205,7 @@
 [ -e "$dir" ] && echo "$dir already exists." && usage
 mkdir -p "$dir" &&
 D=$(cd "$dir" && pwd) &&
-trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0
+trap 'err=$?; cd ..; rm -r "$D"; EXIT $err' 0
 case "$bare" in
 yes)
        GIT_DIR="$D" ;;

-- 
S.Çağlar Onur [off-list ref]
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

Re: [Patch] trap: exit: invalid signal specification

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:30

quoted hunk
diff -ur git-1.4.0.orig/git-clone.sh git-1.4.0/git-clone.sh
--- git-1.4.0.orig/git-clone.sh 2006-06-10 22:41:54.000000000 +0300
+++ git-1.4.0/git-clone.sh      2006-06-24 03:54:49.000000000 +0300
@@ -205,7 +205,7 @@
 [ -e "$dir" ] && echo "$dir already exists." && usage
 mkdir -p "$dir" &&
 D=$(cd "$dir" && pwd) &&
-trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0
+trap 'err=$?; cd ..; rm -r "$D"; EXIT $err' 0
 case "$bare" in
 yes)
I am not quite sure what to make out this...  Do you mean your
shell does not like the command "exit" spelled in lowercase
under Turkic locale?

Re: [Patch] trap: exit: invalid signal specification

From: S.Çağlar Onur <hidden>
Date: 2016-06-15 22:42:31

Cumartesi 24 Haziran 2006 05:50 tarihinde, Junio C Hamano şunları yazmıştı: 
I am not quite sure what to make out this...  Do you mean your
shell does not like the command "exit" spelled in lowercase
under Turkic locale?
Sorry to not clear enough previously, for Turkic locales (tr_TR, az_AZ etc.) 
upper(i) != I. More detailed analysis can be found at 
http://www.i18nguy.com/unicode/turkish-i18n.html, "Why Applications Fail With 
The Turkish Language" section. This is the main reason of this problem. 

According to its man page signals defined with uppercase letters but also 
different trap implementations may permit lowercase signal names as an 
extension. 

As an example bash (v. 3.1.17) permits lowercase signal names but it converts 
this lowercase signal names into uppercase ones while interpreting the 
script. But for our "Turkish has 4 letter "I"s" problem this convert to 
uppercase one process fails but for bash invalid signal names not be 
considered a syntax error and do not cause the shell to abort. 

Yours
-- 
S.Çağlar Onur [off-list ref]
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!

Re: [Patch] trap: exit: invalid signal specification

From: Matthias Lederhofer <hidden>
Date: 2016-06-15 22:42:31

As an example bash (v. 3.1.17) permits lowercase signal names but it converts 
this lowercase signal names into uppercase ones while interpreting the 
script. But for our "Turkish has 4 letter "I"s" problem this convert to 
uppercase one process fails but for bash invalid signal names not be 
considered a syntax error and do not cause the shell to abort. 
It is ``trap <action> <signal>'' so for the signal part this may be
right that this is made uppercase. But action is not modified I guess.
So it should be exit because there is no built-in named EXIT in
bash:

$ type exit
exit is a shell builtin
$ type EXIT
bash: type: EXIT: not found

So for me it does not seem to work:

$ trap 'err=$?; echo trap; EXIT $?' 0
$ exit 5
exit
trap
bash: EXIT: command not found
[1]    12906 exit 5     bash
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help