#9811: sage exits with 0, even if it is unable to install a package.
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |       Owner:  GeorgSWeber
       Type:  defect    |      Status:  new        
   Priority:  major     |   Milestone:  sage-4.6   
  Component:  build     |    Keywords:             
     Author:            |    Upstream:  N/A        
   Reviewer:            |      Merged:             
Work_issues:            |  
------------------------+---------------------------------------------------

Comment(by leif):

 From {{{sage-sage}}}:
 {{{
 #!sh
 ...
 install() {
    cd "$SAGE_ROOT/spkg"
    if [ $# -lt 2 ]; then
        sage-spkg
        exit $?
    fi
    OPT="$1"
    shift
    if [ "$1" = '-m' -o "$1" = '-s' ]; then
        OPT=$OPT" "$1
        shift
    fi
    SAGE_LOGS="$SAGE_ROOT/spkg/logs"
    if [ ! -d "$SAGE_LOGS" ]; then
        mkdir -p "$SAGE_LOGS"
    fi
    for PKG in "$@"
    do
        echo "Calling sage-spkg on $PKG"
        PKG_NAME=`echo "$PKG" | sed -e "s/\.spkg$//"`
        PKG_NAME=`basename "$PKG_NAME"`
        case $PKG in
        /*)
            sage-spkg $OPT "$PKG" 2>&1 | (trap "" SIGINT; tee -a
 ../install.log "$SAGE_LOGS/$PKG_NAME".log)
        ;;
        *)
            sage-spkg $OPT "$CUR/$PKG" 2>&1 | (trap "" SIGINT; tee -a
 ../install.log "$SAGE_LOGS/$PKG_NAME".log)
        ;;
        esac

        if [ $? -ne 0 ]; then
           exit 1
        fi
        shift
    done
    exit $?
 }
 ...
 if [ "$1" = '-i' ]; then
    shift
    echo "Installing $@"
    install " " "$@"
 fi

 if [ "$1" = '-f' ]; then
    shift
    echo "Force installing $@"
    install -f "$@"
 fi
 ...
 }}}

 So once again, we get the exit status of {{{tee}}} rather than that of
 {{{sage-spkg}}}.

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