#10339: Simplify spkg/pipestatus
------------------------+---------------------------------------------------
   Reporter:  jdemeyer  |       Owner:  GeorgSWeber        
       Type:  defect    |      Status:  new                
   Priority:  major     |   Milestone:  sage-4.6.1         
  Component:  build     |    Keywords:  pipestatus Makefile
     Author:            |    Upstream:  N/A                
   Reviewer:            |      Merged:                     
Work_issues:            |  
------------------------+---------------------------------------------------

Comment(by leif):

 Perhaps better
 {{{
 #!diff
 --- pipestatus.orig     2010-07-22 10:54:43.000000000 +0200
 +++ pipestatus  2010-11-26 16:35:44.000000000 +0100
 @@ -1,6 +1,6 @@
  #!/usr/bin/env bash

 -if [ -z "$1" ]; then
 +if [ $# -ne 2 ] || [ -z "$1" -o -z "$2" ]; then
      echo "Run two commands in a pipeline 'CMD1 | CMD2' and exit"
      echo "with the exit status of CMD1, *not* that of CMD2."
      echo "$0 cmd1 cmd2"
 @@ -16,7 +16,8 @@

  if [ $VER -gt 2 ]; then
      # Use bash 3.0's pipefail option.
 -    (set -o pipefail; eval "$1 | $2")
 +    set -o pipefail
 +    eval "( $1 ) | ( $2 )"
      exit $?
  else
      # Use redirection.  Adapted from the comp.unix.shell FAQ.  See
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10339#comment:3>
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.

Reply via email to