Ticket #5155: 5155_root.patch

File 5155_root.patch, 2.2 KB (added by jdemeyer, 10 years ago)
  • spkg/bin/sage

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1318867571 -7200
    # Node ID ac14bac95dbc141c384d2699c8257a5ef2a9ca90
    # Parent  a9011e45347e8cd8c3cd3b7e37c8b8b3d91dd180
    Run sage_setup before testing Sage
    
    diff --git a/spkg/bin/sage b/spkg/bin/sage
    a b  
    285285        cat "$SAGE_LOCAL/bin/sage-banner"
    286286    fi
    287287
    288     # Check to see if the whole Sage install tree has moved.
    289     # If so, change various hardcoded paths.
    290     sage-location || exit $?
     288    # Check to see if the whole Sage install tree has moved.  If so,
     289    # change various hardcoded paths.  Skip this if we don't have write
     290    # access to $SAGE_LOCAL (e.g. when running as a different user).
     291    if [ -w "$SAGE_LOCAL" ]; then
     292        sage-location || exit $?
     293    fi
    291294
    292295    export IPYTHONDIR="$DOT_SAGE/ipython"
    293296    export IPYTHONRC="ipythonrc"
     
    782785      touch "$DOT_SAGE"/init.sage
    783786   fi
    784787   shift
     788   SAGE_BANNER="no"
     789   sage_setup
    785790   sage-test "$@"
    786791   exit $?
    787792fi
     
    795800      touch "$DOT_SAGE"/init.sage
    796801   fi
    797802   shift
     803   SAGE_BANNER="no"
     804   sage_setup
    798805   sage-ptest "$@"
    799806   exit $?
    800807fi
     
    804811      build_sage
    805812   fi
    806813   shift
     814   SAGE_BANNER="no"
     815   sage_setup
    807816   sage-test-new "$@"
    808817   exit $?
    809818fi
    810819
    811820if [ "$1" = '-testall' -o "$1" = "--testall" ]; then
    812821   shift
     822   SAGE_BANNER="no"
     823   sage_setup
    813824   sage-maketest "$@"
    814825   exit $?
    815826fi
     
    906917
    907918if [ "$1" = '-info' -o "$1" = '--info' ]; then
    908919    shift
    909     # If there are no further arguments, simply list all installed
    910     # packages.
    911     if [ $# -eq 0 ]; then
    912         exec sage-spkg
    913     fi
    914     install --info "$@"
     920    for PKG in "$@"
     921    do
     922        sage-spkg --info "$PKG" || exit $?
     923    done
     924    exit 0
    915925fi
    916926
    917927if [ "$1" = '-pkg' -o "$1" = '-spkg' -o "$1" = "--pkg" -o "$1" = "--spkg" ]; then
     
    972982    # People often move the Sage install right before doing the upgrade, so it's
    973983    # important to fix any path hardcoding issues first, or certain library
    974984    # links will fail.
    975     sage-location
     985    sage-location || exit $?
    976986
    977987    # Run sage-upgrade twice since when installing sage-scripts and a
    978988    # running script changes, it gets confused and exits with an error.