| 43 | | else |
| 44 | | if [ -f sage -a -d spkg ]; then |
| 45 | | if [ "$SAGE_ROOT" != "`pwd`" ]; then |
| 46 | | echo "Warning: Attempted to overwrite SAGE_ROOT enviroment variable" |
| 47 | | fi |
| 48 | | else |
| 49 | | if [ -f ../../sage -a -d ../../spkg ]; then |
| 50 | | cd ../../ |
| 51 | | if [ "$SAGE_ROOT" != "`pwd`" ]; then |
| 52 | | echo "Warning: Attempted to overwrite SAGE_ROOT enviroment variable" |
| 53 | | fi |
| 54 | | else |
| 55 | | echo "You must set the SAGE_ROOT environment variable or" |
| 56 | | echo "run this script from the SAGE_ROOT or " |
| 57 | | echo "SAGE_ROOT/local/bin/ directory." |
| 58 | | fi |
| 59 | | fi |
| 64 | | echo "SAGE_ROOT must be set" |
| 65 | | exit 1 |
| | 41 | if [ "$GUESSED_SAGE_ROOT" = "" ]; then |
| | 42 | echo "Error: You must set the SAGE_ROOT environment" |
| | 43 | echo "variable or run this script from the SAGE_ROOT or " |
| | 44 | echo "SAGE_ROOT/local/bin/ directory." |
| | 45 | exit 1 |
| | 46 | else |
| | 47 | SAGE_ROOT="$GUESSED_SAGE_ROOT" |
| | 48 | export SAGE_ROOT |
| | 49 | fi |
| | 50 | else |
| | 51 | if [ -f "$SAGE_ROOT"/sage -a -d "$SAGE_ROOT"/spkg ]; then |
| | 52 | # SAGE_ROOT points to a sage installation as expected |
| | 53 | if [ "$SAGE_ROOT" != "$GUESSED_SAGE_ROOT" ]; then |
| | 54 | echo "Warning: Attempted to overwrite SAGE_ROOT environment variable" |
| | 55 | fi |
| | 56 | else |
| | 57 | echo "Error: The SAGE_ROOT environment variable is set to" |
| | 58 | echo "a bad value. You must correct it or erase it and" |
| | 59 | echo "run this script from the SAGE_ROOT or" |
| | 60 | echo "SAGE_ROOT/local/bin/ directory." |
| | 61 | exit 1 |
| | 62 | fi |