Dash:
[t2.git] / package / shells / pdksh / sort-trap.patch
blob29feec468e53b1166b3471d36ed77b8dc2b9cec4
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../pdksh/sort-trap.patch
5 # Copyright (C) 2004 - 2005 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 Hm. I find the resulting output a bit unlogic - but it is exactly the same
18 with the old options and an old sort. So this "chaotic" sort might have
19 been intended - or always been buggy ...
21 Also fixed the trap usage.
23 - Rene Rebe <rene@exactcode.de>
25 --- pdksh-5.2.14/siglist.sh.orig 1996-09-18 18:52:41.000000000 +0200
26 +++ pdksh-5.2.14/siglist.sh 2004-05-05 02:41:53.000000000 +0200
27 @@ -11,19 +11,19 @@
28 out=tmpo$$.c
29 ecode=1
30 trapsigs='0 1 2 13 15'
31 -trap 'rm -f $in $out; trap 0; exit $ecode' $trapsigs
32 +trap 'rm -f $in $out; trap - 0; exit $ecode' $trapsigs
34 CPP="${1-cc -E}"
36 # The trap here to make up for a bug in bash (1.14.3(1)) that calls the trap
37 -(trap $trapsigs;
38 +(trap - $trapsigs;
39 echo '#include "sh.h"';
40 echo ' { QwErTy SIGNALS , "DUMMY" , "hook for number of signals" },';
41 sed -e '/^[ ]*#/d' -e 's/^[ ]*\([^ ][^ ]*\)[ ][ ]*\(.*[^ ]\)[ ]*$/#ifdef SIG\1\
42 { QwErTy SIG\1 , "\1", "\2" },\
43 #endif/') > $in
44 $CPP $in > $out
45 -sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort +2n +0n |
46 +sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -n -k 2 |
47 sed 's/^[0-9]* //' |
48 awk 'BEGIN { last=0; nsigs=0; }