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

Bug#477240: Please clarify status of XSI extensions for kill and trap



Raphael Geissert <atomo64@gmail.com> writes:

> Based on the results from the last archive-wide checkbashisms check on i386, 
> the situation is as follows:

> There are about *91* unique binary packages with at least one match for
> the trap with signal numbers check.

> And about *112* unique binary packages with at least one match for the
> 'kill -[0-9] or -[A-Z]' check.

> Both checks are meant to detect the usage of the widely used XSI
> extensions for kill and trap as documented in [1] and [2] respectively.

[...]

> As it seems lots of people have agreed on using those XSI extensions
> IMHO the policy should be updated to permit the usage of the XSI
> extensions for the trap and kill built-ins as described in the SUSv3
> Shell Command Language in /bin/sh scripts.

> [1]http://www.opengroup.org/onlinepubs/009695399/utilities/kill.html
> [2]http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html

Here's a patch which implements that, plus an additional exception for
libtool scripts which trap SIGPIPE by number.  Objections or seconds?
I'm copying Clint as posh maintainer since this will be relevant to which
features posh implements.

This was discussed a while back on debian-devel, but unfortunately the
discussion at the time wasn't cc'd to the Policy bug.

diff --git a/policy.sgml b/policy.sgml
index bad28af..1658cbf 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -7427,7 +7427,19 @@ fname () {
 </example>
 	      must be supported and must set the value of <tt>c</tt> to
 	      <tt>delta</tt>.
-            </item>
+	    </item>
+	    <item>The XSI extension to <prgn>kill</prgn> allowing <tt>kill
+	      -<var>signal</var></tt>, where <var>signal</var> is either
+	      the name of a signal or one of the numeric signals listed in
+	      the XSI extension (0, 1, 2, 3, 6, 9, 14, and 15), must be
+	      supported.
+	    </item>
+	    <item>The XSI extension to <prgn>trap</prgn> allowing numeric
+	      symbols must be supported.  However, only the signal numbers
+	      listed in the extension, which are the same as
+	      for <prgn>kill</prgn> above, plus SIGPIPE (13) must be
+	      supported.
+	    </item>
 	  </list>
 	  If a shell script requires non-SUSv3 features from the shell
 	  interpreter other than those listed above, the appropriate shell

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: