Opened 12 years ago
Closed 12 years ago
#4470 closed Patches (fixed)
SHELL: fix exit-code and add 'strip-eol' option
Reported by: | Owned by: | René Rivera | |
---|---|---|---|
Milestone: | To Be Determined | Component: | bjam |
Version: | Boost.Jam 3.1.18 | Severity: | Problem |
Keywords: | Cc: |
Description
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 ] ;
Attachments (2)
Change History (7)
by , 12 years ago
Attachment: | shell.patch added |
---|
comment:1 by , 12 years ago
Version: | Boost.Jam 3.1.17 → Boost.Jam 3.1.16 |
---|
by , 12 years ago
Attachment: | shell.2.patch added |
---|
comment:2 by , 12 years ago
Version: | Boost.Jam 3.1.16 → Boost.Jam 3.1.18 |
---|
comment:3 by , 12 years ago
Note: The original patch is against bjam version 3.1.16 . (I originally thought it was against 3.1.17 before realizing my error.)
The new patch is against the current version, 3.1.18.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
updated patch against bjam version 3.1.18