Ticket #9960: trac_9960-scripts-SAGE_CHECK.v2.patch

File trac_9960-scripts-SAGE_CHECK.v2.patch, 3.4 KB (added by jhpalmieri, 10 years ago)

replaces all previous patches

  • sage-env

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1301008361 25200
    # Node ID a9e727f3f9ccacde0639b24aca03b72f44a5d785
    # Parent  d01fc90261bb27331e6fda3c89500e9f7b6aca37
    #9960: require SAGE_CHECK to be "yes"
    
    The patch also fixes two other flaws: 1. Use return instead of exit in
    sage-env, exit with 1 if sourcing sage-env failed.  2. Any output of
    sage-check-64 is redirected to /dev/null.  This should be changed; see
    ticket #10303.
    
    diff -r d01fc90261bb -r a9e727f3f9cc sage-env
    a b if [ "$SAGE_ROOT" = "" ]; then 
    4242        echo "Error: You must set the SAGE_ROOT environment"
    4343        echo "variable or run this script from the SAGE_ROOT or "
    4444        echo "SAGE_ROOT/local/bin/ directory."
    45         exit 1
     45        return 1
    4646    else
    4747        SAGE_ROOT="$GUESSED_SAGE_ROOT"
    4848        export SAGE_ROOT
    else 
    5858        echo "a bad value. You must correct it or erase it and"
    5959        echo "run this script from the SAGE_ROOT or"
    6060        echo "SAGE_ROOT/local/bin/ directory." 
    61         exit 1
     61        return 1
    6262    fi
    6363fi
    6464
    if contains_spaces X${SAGE_ROOT}X ; then 
    8282    echo "It is currently \"$SAGE_ROOT\"."
    8383    echo "Please correct this by moving Sage (or renaming one or more directories) first."
    8484    echo "Exiting now..."
    85     exit 1
     85    return 1
    8686fi
    8787
    8888
    if [ `uname` = "Darwin" ]; then 
    222222fi
    223223
    224224if [ "$1" = "-short" ]; then
    225     exit 0
     225    return 0
    226226fi
    227227
    228228if [ -z "$RHOME" ]; then
    fi 
    281281
    282282if [ "$SAGE64" != "yes" -a "$SAGE64" != "no" ]; then
    283283    echo "The environment variable SAGE64 (=$SAGE64) must be either unset, yes or no."
    284     exit 1
     284    return 1
    285285fi
    286286
    287287# In case SAGE64 has been set to yes before re-inject it into the environment
    288288# This is only done on OSX and Solaris since those are the only real multi lib
    289289# arches we support. Eventually Linux PPC on the PS3 might need to be added here
    290 source $SAGE_LOCAL/bin/sage-check-64 2> /dev/null
     290source $SAGE_LOCAL/bin/sage-check-64 1> /dev/null 2> /dev/null
    291291export SAGE64
    292292
    293293if [ "$CXXFLAGS" = "" ]; then
  • sage-sage

    diff -r d01fc90261bb -r a9e727f3f9cc sage-sage
    a b usage_advanced() { 
    225225if [ $? -ne 0 ]; then
    226226   echo >&2 "Error setting environment variables by running \"$SAGE_ROOT/local/bin/sage-env\";"
    227227   echo >&2 "possibly contact sage-devel (see http://groups.google.com/group/sage-devel)."
     228   exit 1
    228229fi
    229230
    230231# Sage startup script passes some funny options, which are
  • sage-spkg

    diff -r d01fc90261bb -r a9e727f3f9cc sage-spkg
    a b no_version() 
    4646# The following sets environment variables for building
    4747# packages.  (Using dot suggested by W. Cheung.)
    4848
    49 . "$SAGE_ROOT/local/bin/sage-env"
    50 
    51 cd "$SAGE_PACKAGES"
     49. "$SAGE_ROOT/local/bin/sage-env" # *returns* non-zero value on errors rather than exiting
     50 
     51if [ $? -ne 0 ]; then
     52    echo "Error setting environment variables by running \"$SAGE_ROOT/local/bin/sage-env\";"
     53    echo "possibly contact sage-devel (see http://groups.google.com/group/sage-devel)."
     54    exit 1
     55fi
    5256
    5357if [ $# -eq 0 ]; then
    5458    echo "Currently installed packages:"
    if [ $? -eq 0 ]; then 
    368372    echo "Successfully installed $PKG_NAME"
    369373
    370374    cd $BASEDIR
    371     if [ "$SAGE_CHECK" != "" -a -f spkg-check ]; then
     375    if [ "x$SAGE_CHECK" = "xyes" -a -f spkg-check ]; then
    372376        echo "Running the test suite."
    373377        chmod +x spkg-check
    374378        ./spkg-check