Subject: [Boost-bugs] [Boost C++ Libraries] #4470: SHELL: fix exit-code and add 'strip-eol' option
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-26 21:39:02
#4470: SHELL: fix exit-code and add 'strip-eol' option
----------------------------------------+-----------------------------------
Reporter: codemonkey@⦠| Owner: grafik
Type: Patches | Status: new
Milestone: To Be Determined | Component: bjam
Version: Boost.Jam 3.1.17 | Severity: Problem
Keywords: |
----------------------------------------+-----------------------------------
This patch applies WIFEXITED() and WEXITSTATUS() to the exit code returned
by the SHELL rule when the 'exit-code' option is used.
Without these (on Linux, at least) the exit code is left-shifted 8 bits so
that an actual exit code of 1 shows up as 256 and an actual exit code of 2
shows up as 512 (etc).
This patch also adds a new 'strip-eol' option to the SHELL rule. This
causes trailing white space (most importantly, newlines) on the command's
output to be removed before it's returned to the caller. Note that
embedded newlines are left intact; these are needed if the user wants to
echo the output and it contains multiple lines.
Note that 'strip-eol' has no practical effect if 'no-output' is also used.
Usage example:
local foo = [ SHELL "./foo.sh" : exit-code : strip-eol ] ;
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4470> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC