#10339: Simplify spkg/pipestatus
------------------------------+---------------------------------------------
Reporter: jdemeyer | Owner: GeorgSWeber
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.6.1
Component: build | Keywords: pipestatus Makefile
Author: Jeroen Demeyer | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Comment(by leif):
As a compromise, I'd suggest using simply Bash's `PIPESTATUS` array, which
is available in by far older versions as well, e.g.
{{{
#!sh
...
# e.g. eval "$1 | $2"
# or eval "$1" | eval "$2"
if [ ${PIPESTATUS[0]} -ne 0 ]; then
exit ${PIPESTATUS[0]}
else
exit ${PIPESTATUS[1]} # equivalent to exit $? (if 'pipefail' is
not set)
fi
# NOTREACHED
}}}
As you can see, the `else` part is completely redundant, since a script
does `exit $?` by default.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10339#comment:19>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.