Ticket #13190: trac13190_scripts.patch

File trac13190_scripts.patch, 2.6 KB (added by ohanar, 9 years ago)

apply to scripts repo

  • sage-build

    # HG changeset patch
    # User R. Andrew Ohana <andrew.ohana@gmail.com>
    # Date 1341136674 25200
    # Node ID 6cb735b7475bb7333e8d7e954a0dd8c7f2c509a7
    # Parent  4c2f31701c6182f33e4bdd42abf0f3815f318c7a
    use setuptools "setup.py develop" for better tracebacks
    
    diff --git a/sage-build b/sage-build
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ -z "$SAGE_LOCAL" ]; then
    4     echo
    5     echo "SAGE_LOCAL undefined ... exiting"
    6     return 1
    7 fi
     3die() {
     4   echo >&2 "$@"
     5   exit 1
     6}
     7
     8[ -n "$SAGE_LOCAL" ] || die "SAGE_LOCAL undefined ... exiting"
    89
    910build() {
    1011   if [ -d "$SAGE_ROOT/devel/$1/" ]; then
    1112      cd "$SAGE_ROOT/devel/$1/"
    12       chmod +x ./install
    1313      echo ""
    1414      echo "----------------------------------------------------------"
    1515      echo "sage: Building and installing modified Sage library files."
     
    2626      echo "Installing c_lib"
    2727      CUR=`pwd`
    2828      cd "c_lib"
    29       scons -Q install
    30       # make sure c_lib install went okay
    31       if [ $? -ne 0 ]; then
    32           echo >&2 "Error building c_lib."
    33           exit 1
    34       fi
     29      scons -Q install ||
     30         die "Error building c_lib."
    3531      cd "$CUR"
    3632
    37       ./install "$SAGE_ROOT"
    38       if [ $? -ne 0 ]; then
    39          echo >&2 "Error installing modified $1 library code."
    40          exit 1
    41       fi
     33      python setup.py install ||
     34         die "Error installing modified $1 library code."
     35
     36      # remove the sage symlink if it exists -- this is for upgrading purposes
     37      rm -f "$SAGE_LOCAL/lib/python/site-packages/sage"
    4238   fi
    4339}
    4440
     
    5248if [ "$1" != "" ]; then
    5349    # make devel/sage point to devel/$1
    5450    cd "$SAGE_ROOT/devel/"
    55     if [ ! -d "sage-$1" ]; then
    56         # this will happen a lot because of people (=me) making typos.
    57         echo >&2 "No such branch '$SAGE_ROOT/devel/sage-$1'"
    58         echo >&2 "Use 'sage --clone' to create a new branch."
    59         exit 1
    60     fi
     51    # this will happen a lot because of people (=William) making typos.
     52    [ -d "sage-$1" ] || die "No such branch '$SAGE_ROOT/devel/sage-$1'\nUse 'sage --clone' to create a new branch."
    6153    # On Solaris (and perhaps other systems), "ln -snf FILE LINK"
    6254    # doesn't remove LINK and then relink it, so we need to first
    6355    # delete LINK -- in this case, SAGE_ROOT/devel/sage -- and then
     
    6759    ln -s "sage-$1" sage
    6860fi
    6961
    70 if [ ! -d "$SAGE_ROOT/devel/sage" ]; then
    71     echo >&2 "There is no directory '$SAGE_ROOT/devel/sage'"
    72     exit 1
    73 fi
     62[ -d "$SAGE_ROOT/devel/sage" ] || die "There is no directory '$SAGE_ROOT/devel/sage'"
    7463
    7564if [ $DO_BUILD_ALL = 1 ]; then
    7665    CUR=`pwd`