Ticket #12613: trac_12613-root.post12602.patch

File trac_12613-root.post12602.patch, 2.8 KB (added by jhpalmieri, 9 years ago)
  • spkg/bin/sage

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1330551509 28800
    # Node ID 09448bec4c91551fc5d4ccfe933aac316354e912
    # Parent  a0550ec9b015854bfa454fb31bc174472ae0512e
    Add '-c' option so 'sage -i -c <pkg>' will install <pkg> and run its test suite
    
    diff --git a/spkg/bin/sage b/spkg/bin/sage
    a b usage_advanced() { 
    116116    echo "  -f [packages]       -- force build of the given Sage package (even if it is"
    117117    echo "                         already installed)"
    118118    echo "  -f -s [packages]    -- like -f but do not delete the spkg/build directories"
     119    echo "  -f -c [packages]    -- like -f but also run the packages' test suites"
    119120    echo "  -i [packages]       -- install the given Sage packages"
    120121    echo "                         if no packages given, print a list of all installed"
    121122    echo "  -i -s [packages]    -- like -i but do not delete the spkg/build directories"
     123    echo "  -i -c [packages]    -- like -i but also run the packages' test suites"
    122124    echo "  -optional           -- list all optional packages that can be installed"
    123125    echo "  -standard           -- list all standard packages that can be installed"
    124126   #echo "  -update             -- download latest non-optional Sage packages (do not build them)"
    install() { 
    779781                continue;;
    780782            -s) OPTS="-s"
    781783                continue;;
     784            -c) OPTC="-c"
     785                continue;;
     786            --check) OPTC="-c"
     787                continue;;
    782788        esac
    783789
    784790        echo "Calling sage-spkg on '$PKG'"
    install() { 
    786792        PKG_NAME=`basename "$PKG_NAME"`
    787793
    788794        "$SAGE_ROOT"/spkg/pipestatus \
    789             "sage-spkg $OPTF $OPTS '$PKG' 2>&1" \
     795            "sage-spkg $OPTF $OPTS $OPTC '$PKG' 2>&1" \
    790796            "(trap '' SIGINT; tee -a '$SAGE_ROOT/install.log' '$SAGE_LOGS/$PKG_NAME.log')"
    791797        # Do not try to install further packages if one failed
    792798        if [ $? -ne 0 ]; then
  • spkg/bin/sage-spkg

    diff --git a/spkg/bin/sage-spkg b/spkg/bin/sage-spkg
    a b  
    88#  Options can be:
    99#   -f: install a package even if the same version is already installed
    1010#   -s: do not delete temporary build directory
     11#   -c: after installing, run the test suite for the spkg. This should
     12#       override the settings of SAGE_CHECK and SAGE_CHECK_PACKAGES.
    1113#
    1214#  A package may assume that the following environment
    1315#  variables are defined:
    else 
    175177    unset UNTAR_VERBOSE
    176178fi
    177179
     180if [ $1 = '-c' ]; then
     181    export SAGE_CHECK=yes
     182    SAGE_CHECK_PACKAGES='x' # nonempty, so not set to '!python' later
     183    shift
     184fi
     185
    178186##################################################################
    179187# Figure out the package filename, download it if needed.
    180188##################################################################