| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | ####################################### |
|---|
| 4 | # Install SAGE libraries |
|---|
| 5 | ####################################### |
|---|
| 6 | |
|---|
| 7 | CUR=`pwd` |
|---|
| 8 | |
|---|
| 9 | if [ $? -ne 0 ]; then |
|---|
| 10 | exit 1 |
|---|
| 11 | fi |
|---|
| 12 | |
|---|
| 13 | DEVEL=$SAGE_ROOT/devel |
|---|
| 14 | |
|---|
| 15 | if [ ! -d "$DEVEL" ]; then |
|---|
| 16 | mkdir "$DEVEL" |
|---|
| 17 | fi |
|---|
| 18 | |
|---|
| 19 | if [ $? -ne 0 ]; then |
|---|
| 20 | exit 1 |
|---|
| 21 | fi |
|---|
| 22 | |
|---|
| 23 | D=`pwd` |
|---|
| 24 | E=`basename "$D"` |
|---|
| 25 | |
|---|
| 26 | if [ ! -d "$DEVEL/old" ]; then |
|---|
| 27 | mkdir "$DEVEL/old" |
|---|
| 28 | fi |
|---|
| 29 | |
|---|
| 30 | if [ ! -f "$DEVEL/sage-main"/.hg/00changelog.i ]; then |
|---|
| 31 | mv "$DEVEL/sage-main" "$DEVEL/old/sage-bad_delete_me" |
|---|
| 32 | fi |
|---|
| 33 | |
|---|
| 34 | if [ -d "$DEVEL/sage-main" ]; then |
|---|
| 35 | cd "$DEVEL/sage-main" |
|---|
| 36 | #hg pull "$SAGE_SERVER"/hg/sage-main |
|---|
| 37 | # Pull in changes from the archive just downloaded. |
|---|
| 38 | hg pull "$CUR" |
|---|
| 39 | hg merge tip |
|---|
| 40 | hg ci -m "merge" |
|---|
| 41 | # Make the pulled in changes take effect. |
|---|
| 42 | hg update |
|---|
| 43 | |
|---|
| 44 | # Since we are doing an upgrade, it is very important that the |
|---|
| 45 | # build always completely works with no dependency issues. It is |
|---|
| 46 | # OK if the build takes a little longer, since this is a full |
|---|
| 47 | # upgrade. So we touch all pyrex code. |
|---|
| 48 | |
|---|
| 49 | touch */*.pyx */*/*.pyx */*/*/*.pyx */*/*/*/*.pyx */*/*/*/*/*.pyx */*/*/*/*/*.pyx */*/*/*/*/*/*.pyx 2> /dev/null |
|---|
| 50 | |
|---|
| 51 | # Delete the scons target too |
|---|
| 52 | cd c_lib |
|---|
| 53 | rm *.os *.so # just to be sure! |
|---|
| 54 | scons -c "$SAGE_LOCAL"/include/ |
|---|
| 55 | scons -c "$SAGE_LOCAL"/lib/ # delete target |
|---|
| 56 | cd .. |
|---|
| 57 | |
|---|
| 58 | # We also delete the build directory, since it could contain |
|---|
| 59 | # old .py files we don't want anymore. |
|---|
| 60 | rm -rf build |
|---|
| 61 | |
|---|
| 62 | "$SAGE_ROOT/sage" -b main |
|---|
| 63 | if [ $? -ne 0 ]; then |
|---|
| 64 | echo "Error building new version of SAGE." |
|---|
| 65 | fi |
|---|
| 66 | exit $? |
|---|
| 67 | fi |
|---|
| 68 | |
|---|
| 69 | mkdir "$DEVEL/sage-main" |
|---|
| 70 | cp -pr * .hg* "$DEVEL/sage-main/" |
|---|
| 71 | |
|---|
| 72 | cd "$DEVEL/sage-main" |
|---|
| 73 | |
|---|
| 74 | # touch and build everything |
|---|
| 75 | sage -b main |
|---|
| 76 | |
|---|
| 77 | # repeat -- this copies over all the pyx files, so they appear when |
|---|
| 78 | # you use inspect. |
|---|
| 79 | sage -b main |
|---|
| 80 | |
|---|
| 81 | if [ $? -ne 0 ]; then |
|---|
| 82 | echo "ERROR installing SAGE" |
|---|
| 83 | exit 1 |
|---|
| 84 | fi |
|---|