Ticket #9433: trac_9433-scripts.v9.patch

File trac_9433-scripts.v9.patch, 17.3 KB (added by jhpalmieri, 9 years ago)

patch for scripts repo

  • sage-bdist

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1298605681 28800
    # Node ID cd26ce8a6e0d71dd88f7d96dd3d0fa13d05672b4
    # Parent  e7a865848991d4703937d1d4cd29ebdd8bc9eaac
    #9433: put more files under revision control.  scripts patch.
    
    diff -r e7a865848991 -r cd26ce8a6e0d sage-bdist
    a b PKGDIR=spkg 
    1717
    1818CUR=`pwd`
    1919
    20 OPT="pPR"
     20CP_OPT="-pPR"
    2121
    2222if [ $# -ne 2 ]; then
    2323   echo "Usage: $0 <SAGE_VERSION> <SAGE_ROOT>"
    TARGET=sage-"$SAGE_VERSION"-`uname -m`-` 
    3232TARGET=`echo $TARGET | sed -e 's/ //'`     #no blank spaces
    3333TMP="$CUR/tmp/$TARGET"
    3434
    35 if [ ! -d "$CUR/tmp" ]; then
    36    mkdir "$CUR/tmp"
     35mkdir -p "$CUR/tmp"
     36
     37rm -rf "$TMP"
     38mkdir "$TMP"
     39
     40# copy sage root repo over:
     41cd "$SAGE_ROOT"
     42
     43echo "Copying root repository..."
     44"$SAGE_ROOT"/sage --hg clone --pull . "$TMP"
     45
     46if [ $? -ne 0 ]; then
     47    echo "Error copying Sage root repository."
     48    exit 1
    3749fi
    3850
    39 if [ -d "$TMP" ]; then
    40    rm -rf "$TMP"
    41 fi
    42 
    43 mkdir "$TMP"
     51rm "$TMP"/.hg/hgrc
     52echo "Done copying root repository."
    4453
    4554cd "$SAGE_ROOT"
    4655
    4756echo "Copying files over to tmp directory"
    48 cp -$OPT examples local Makefile *.txt *.sage sage ipython data "$TMP"/
     57cp $CP_OPT examples local data "$TMP"/
    4958
    5059if [ -d devel/sage-main ]; then
    5160   echo "Copying Sage library over"
    5261   mkdir "$TMP"/devel/
    53    cp -L$OPT devel/sage-main "$TMP"/devel/sage-main
    54    cp -L$OPT devel/sagenb-main "$TMP"/devel/sagenb-main
    55    cd $TMP/devel
     62   cp -L $CP_OPT devel/sagenb-main "$TMP"/devel/sagenb-main
     63   cp -L $CP_OPT devel/sage-main "$TMP"/devel/sage-main
     64   cd "$TMP"/devel
    5665   ln -s sage-main sage
    5766   ln -s sagenb-main sagenb
    5867   cd sage
    fi 
    6574
    6675cd "$SAGE_ROOT"
    6776
    68 if [ -d $PKGDIR ]; then
     77if [ -d "$PKGDIR" ]; then
    6978   echo "Making empty spkg's"
    70    cd $PKGDIR
    71    mkdir $TMP/$PKGDIR
    72    mkdir $TMP/$PKGDIR/build
    73    mkdir $TMP/$PKGDIR/optional
    74    cp -$OPT installed $TMP/$PKGDIR/
    75    cp -$OPT standard $TMP/$PKGDIR/
    76    cp  install README.txt gen_html pipestatus $TMP/$PKGDIR/
    77    cd $TMP/$PKGDIR/standard/
    78    for F in `/bin/ls *.spkg`; do
    79        echo "Placeholder spkg file so this binary version of Sage knows this package version used when installing Sage." > $F
     79   cd "$PKGDIR"
     80   mkdir "$TMP/$PKGDIR"/build
     81   mkdir "$TMP/$PKGDIR"/optional
     82   cp $CP_OPT installed "$TMP/$PKGDIR/"
     83   cp $CP_OPT standard "$TMP/$PKGDIR/"
     84   cd "$TMP/$PKGDIR"/standard/
     85   for spkg in *.spkg; do
     86       echo "Placeholder spkg file so this binary version of Sage knows this package version used when installing Sage." >"$spkg"
    8087   done
    8188   # sage -sdist uses the following file to detect if it's working with
    8289   # a "bdisted" copy
    if [ "$UNAME" = "Darwin" ]; then 
    8895    cd "$TARGET"
    8996    mkdir x
    9097    echo "There will be an error about x below that you can safely ignore."
    91     mv * x
     98    mv * .hg* x
    9299    mv x sage
    93100    cp sage/local/bin/sage-README-osx.txt README.txt
    94101
    if [ "$UNAME" = "Darwin" ]; then 
    120127        fi
    121128
    122129        echo 'Copying Sage.app'
    123         cp -L$OPT "$SAGE_ROOT/data/extcode/sage/ext/mac-app/build/$CONFIGURATION/Sage.app" ./Sage.app
     130        cp -L $CP_OPT "$SAGE_ROOT/data/extcode/sage/ext/mac-app/build/$CONFIGURATION/Sage.app" ./Sage.app
    124131        # Info.plist is a binary plist, so convert it for processing with sed.
    125132        # I would just change it to be an xml plist, but xcode changes it back.
    126133        plutil -convert xml1 ./Sage.app/Contents/Info.plist
    if [ "$UNAME" = "Darwin" ]; then 
    142149    if [ "$SAGE_APP_DMG" != "no" ]; then
    143150        echo "Creating dmg"
    144151        echo "(If you don't wish to create a disk image please set SAGE_APP_DMG=no)"
    145         DYLD_LIBRARY_PATH=$SAGE_ORIG_DYLD_LIBRARY_PATH; export DYLD_LIBRARY_PATH
     152        DYLD_LIBRARY_PATH="$SAGE_ORIG_DYLD_LIBRARY_PATH"; export DYLD_LIBRARY_PATH
    146153        hdiutil create -srcfolder "$TARGET" -format UDBZ "$TARGET".dmg
    147154    else
    148155        echo 'If you wish to create a disk image please set'
    else 
    157164    tar zcvf "$TARGET".tar.gz "$TARGET"
    158165fi
    159166
    160 if [ ! -d $SAGE_ROOT/dist ]; then
    161     mkdir $SAGE_ROOT/dist
    162 fi
     167mkdir -p "$SAGE_ROOT"/dist
    163168
    164 if [ -d $SAGE_ROOT/dist/$TARGET ]; then
    165     rm -rf "$SAGE_ROOT/dist/$TARGET"
    166 fi
     169rm -rf "$SAGE_ROOT/dist/$TARGET"
    167170
    168171echo "Moving final distribution file to $SAGE_ROOT/dist"
    169172
    170 mv $TARGET $SAGE_ROOT/dist/
    171 mv $TARGET.* $SAGE_ROOT/dist/
     173mv "$TARGET" "$SAGE_ROOT"/dist/
     174mv "$TARGET".* "$SAGE_ROOT"/dist/
  • sage-make_devel_packages

    diff -r e7a865848991 -r cd26ce8a6e0d sage-make_devel_packages
    a b fi 
    1414
    1515SAGE_VERSION=$1
    1616SAGE_ROOT=$2
    17 SPKG_INST=$SAGE_ROOT/spkg/installed/
     17SPKG_INST="$SAGE_ROOT"/spkg/installed/
    1818export SAGE_ROOT SAGE_VERSION
    19 TARGET="sage-"$1
     19TARGET=sage-$1
    2020
    2121# REMOVE OLD PACKAGES
    2222cd "$SAGE_ROOT"/spkg/standard/
    rm examples-*.spkg 
    2525rm extcode-*.spkg
    2626rm sage-*.spkg
    2727rm sage_scripts-*.spkg
     28rm sage_root-*.spkg
    2829
    2930if [ $# -eq 2 ]; then
    3031   DESTINATION="$SAGE_ROOT"/spkg/standard/
    else 
    3233   DESTINATION=$3
    3334fi
    3435
    35 if [ ! -d $DESTINATION ]; then
    36    mkdir $DESTINATION
     36if [ ! -d "$DESTINATION" ]; then
     37   mkdir "$DESTINATION"
    3738fi
    3839
    3940cd "$DESTINATION"
    4041DESTINATION=`pwd`
    41 PKG=$DESTINATION
     42PKG="$DESTINATION"
    4243
    4344# NEW SAGE SOURCE PACKAGE
    44 if [ -d $SAGE_ROOT/devel/sage-main ]; then
    45    cd $SAGE_ROOT/devel/sage-main
     45if [ -d "$SAGE_ROOT"/devel/sage-main ]; then
     46   cd "$SAGE_ROOT"/devel/sage-main
    4647   hg diff
    4748   hg status
    4849   hg tag "$SAGE_VERSION"
    4950   hg commit -m "$SAGE_VERSION"
    5051   #./sage-push
    5152   chmod +x spkg-dist
    52    ./spkg-dist $SAGE_VERSION $SAGE_ROOT
     53   ./spkg-dist "$SAGE_VERSION" "$SAGE_ROOT"
    5354   if [ $? -ne 0 ]; then
    54        echo "Error building the sage source code package"
     55       echo "Error building the Sage source code package"
    5556       exit 1
    5657   fi
    57    mv dist/sage-$SAGE_VERSION.spkg $DESTINATION/
    58    touch $SPKG_INST/sage-$SAGE_VERSION
     58   mv dist/sage-"$SAGE_VERSION".spkg "$DESTINATION"/
     59   touch "$SPKG_INST"/sage-"$SAGE_VERSION"
    5960fi
    6061
    61 if [ ! -f $PKG/sage-$SAGE_VERSION.spkg ]; then
     62if [ ! -f "$PKG"/sage-"$SAGE_VERSION".spkg ]; then
    6263    echo "The package sage-$SAGE_VERSION.spkg wasn't created."
    6364    exit 1
    6465fi
    6566
    6667# NEW SAGE EXTERNAL CODE PACKAGE
    67 if [ -d $SAGE_ROOT/data/extcode ]; then
    68    cd $SAGE_ROOT/data/extcode
     68if [ -d "$SAGE_ROOT"/data/extcode ]; then
     69   cd "$SAGE_ROOT"/data/extcode
    6970   hg diff
    7071   hg status
    7172   hg tag "$SAGE_VERSION"
    if [ -d $SAGE_ROOT/data/extcode ]; then 
    7374 
    7475   #./sage-push
    7576   chmod +x spkg-dist
    76    ./spkg-dist $SAGE_VERSION $SAGE_ROOT
     77   ./spkg-dist "$SAGE_VERSION" "$SAGE_ROOT"
    7778   if [ $? -ne 0 ]; then
    7879       echo "Error building the extcode package"
    7980       exit 1
    8081   fi
    81    mv extcode-$SAGE_VERSION.spkg $DESTINATION/
    82    touch $SPKG_INST/extcode-$SAGE_VERSION
     82   mv extcode-"$SAGE_VERSION".spkg "$DESTINATION"/
     83   touch "$SPKG_INST"/extcode-"$SAGE_VERSION"
    8384fi
    8485
    8586
    86 if [ ! -f $PKG/extcode-$SAGE_VERSION.spkg ]; then
     87if [ ! -f "$PKG"/extcode-"$SAGE_VERSION".spkg ]; then
    8788    echo "The package extcode-$SAGE_VERSION.spkg wasn't created."
    8889    exit 1
    8990fi
    9091
    9192# NEW SAGE EXAMPLE CODE PACKAGE
    92 if [ -d $SAGE_ROOT/examples ]; then
    93    cd $SAGE_ROOT/examples
     93if [ -d "$SAGE_ROOT"/examples ]; then
     94   cd "$SAGE_ROOT"/examples
    9495   hg diff
    9596   hg status
    9697   hg tag "$SAGE_VERSION"
    9798   hg commit -m "$SAGE_VERSION"
    9899   #./sage-push
    99100   cd ..
    100    rm -rf examples-$SAGE_VERSION
    101    cp -r examples examples-$SAGE_VERSION
    102    "$SAGE_ROOT"/sage -pkg examples-$SAGE_VERSION
     101   rm -rf examples-"$SAGE_VERSION"
     102   cp -r examples examples-"$SAGE_VERSION"
     103   "$SAGE_ROOT"/sage -pkg examples-"$SAGE_VERSION"
    103104   if [ $? -ne 0 ]; then
    104105       echo "Error building examples package"
    105106       exit 1
    106107   fi
    107    mv examples-$SAGE_VERSION.spkg $DESTINATION/
    108    rm -rf examples-$SAGE_VERSION
    109    touch $SPKG_INST/examples-$SAGE_VERSION
     108   mv examples-"$SAGE_VERSION".spkg "$DESTINATION"/
     109   rm -rf examples-"$SAGE_VERSION"
     110   touch "$SPKG_INST"/examples-"$SAGE_VERSION"
    110111fi
    111112
    112 if [ ! -f $PKG/examples-$SAGE_VERSION.spkg ]; then
     113if [ ! -f "$PKG"/examples-"$SAGE_VERSION".spkg ]; then
    113114    echo "The package examples-$SAGE_VERSION.spkg wasn't created."
    114115    exit 1
    115116fi
    fi 
    119120
    120121
    121122# NEW SAGE SCRIPTS PACKAGE
    122 SCRIPTS=sage_scripts-$SAGE_VERSION
    123 cd $SAGE_ROOT/local/bin/
     123SCRIPTS=sage_scripts-"$SAGE_VERSION"
     124cd "$SAGE_ROOT"/local/bin/
    124125
    125126#./sage-push
    126127hg diff
    if [ $? -ne 0 ]; then 
    133134    exit 1
    134135fi
    135136
    136 rm -rf $SCRIPTS
    137 mkdir $SCRIPTS
     137rm -rf "$SCRIPTS"
     138mkdir "$SCRIPTS"
    138139chmod +x sage-*
    139140chmod -x sage-README-osx.txt sage-banner sage-gdb-commands
    140141chmod -x sage-maxima.lisp sage-verify-pyc
    141142rm sage-*~
    142143
    143 cp -pr sage-* .hg* ipy_profile_sage.py $SCRIPTS/
    144 cp -p $SAGE_ROOT/sage-python $SCRIPTS/
    145 cp -p $SAGE_ROOT/COPYING.txt $SCRIPTS/
    146 cp -p $SAGE_ROOT/README.txt $SCRIPTS/
    147 cp -pr $SAGE_ROOT/ipython $SCRIPTS/
    148 cp -p $SAGE_ROOT/spkg/install $SCRIPTS/
    149 cp -p $SAGE_ROOT/local/bin/sage-spkg-install $SCRIPTS/spkg-install
    150 cp -p $SAGE_ROOT/local/bin/SbuildHack.pm $SCRIPTS/
    151 cp -p $SAGE_ROOT/local/bin/ncadoctest.py $SCRIPTS/
    152 cp -p $SAGE_ROOT/local/bin/sagedoctest.py $SCRIPTS/
     144cp -pr sage-* .hg* ipy_profile_sage.py "$SCRIPTS"/
     145cp -p "$SAGE_ROOT"/local/bin/sage-spkg-install "$SCRIPTS"/spkg-install
     146cp -p "$SAGE_ROOT"/local/bin/SbuildHack.pm "$SCRIPTS"/
     147cp -p "$SAGE_ROOT"/local/bin/ncadoctest.py "$SCRIPTS"/
     148cp -p "$SAGE_ROOT"/local/bin/sagedoctest.py "$SCRIPTS"/
    153149
    154 chmod +x $SCRIPTS/spkg-install
    155 tar -jcf $SCRIPTS.spkg $SCRIPTS
    156 mv $SCRIPTS.spkg $DESTINATION/
    157 rm -rf $SCRIPTS
    158 touch $SPKG_INST/sage_scripts-$SAGE_VERSION
     150chmod +x "$SCRIPTS"/spkg-install
     151tar -jcf "$SCRIPTS".spkg "$SCRIPTS"
     152mv "$SCRIPTS".spkg "$DESTINATION"/
     153rm -rf "$SCRIPTS"
     154touch "$SPKG_INST"/sage_scripts-"$SAGE_VERSION"
    159155
    160 if [ ! -f $PKG/sage_scripts-$SAGE_VERSION.spkg ]; then
     156if [ ! -f "$PKG/sage_scripts-$SAGE_VERSION.spkg" ]; then
    161157    echo "The package sage_scripts-$SAGE_VERSION.spkg wasn't created."
    162158    exit 1
    163159fi
     160
     161#################################
     162
     163# SAGE ROOT PACKAGE: sage-sdist already tags and commits the repo, so
     164# we just need to build the spkg file.
     165
     166ROOT_REPO=sage_root-"$SAGE_VERSION"
     167cd "$SAGE_ROOT"
     168
     169rm -rf "$ROOT_REPO"
     170mkdir "$ROOT_REPO"
     171cd "$ROOT_REPO"
     172
     173echo "Copying root repository..."
     174"$SAGE_ROOT"/sage --hg clone --pull "$SAGE_ROOT" .
     175
     176if [ $? -ne 0 ]; then
     177    echo "Error copying Sage root repository."
     178    exit 1
     179fi
     180
     181rm .hg/hgrc
     182cd "$SAGE_ROOT"
     183
     184cp -p "$SAGE_ROOT"/spkg/root-spkg-install "$ROOT_REPO"/spkg-install
     185chmod +x "$ROOT_REPO"/spkg-install
     186
     187echo "Done copying root repository."
     188
     189tar -jcf "$ROOT_REPO".spkg "$ROOT_REPO"
     190mv "$ROOT_REPO".spkg "$DESTINATION"/
     191rm -rf "$ROOT_REPO"
     192touch "$SPKG_INST/$ROOT_REPO"
     193
     194if [ ! -f "$PKG/$ROOT_REPO".spkg ]; then
     195    echo "The package $ROOT_REPO.spkg wasn't created."
     196    exit 1
     197fi
  • sage-sdist

    diff -r e7a865848991 -r cd26ce8a6e0d sage-sdist
    a b EOF 
    3939fi
    4040
    4141LD_LIBRARY_PATH="$SAGE_ROOT/local/lib:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH
    42 export SAGE_ROOT SAGE_VERSION 
    43 TARGET="sage-"$1
     42export SAGE_ROOT SAGE_VERSION
     43TARGET="sage-$1"
    4444
    4545CUR=`pwd`
    4646
    echo "Sage version $SAGE_VERSION, releas 
    5151
    5252# Update Sage version file in devel/sage/sage: this is done here so
    5353# the banner produced below this if block is correct.
    54 if [ -d $SAGE_ROOT/devel/sage/sage ]; then
    55    cd $SAGE_ROOT/devel/sage/sage
     54if [ -d "$SAGE_ROOT"/devel/sage/sage ]; then
     55   cd "$SAGE_ROOT"/devel/sage/sage
    5656   echo '"""nodoctests"""' > version.py
    5757   echo "version='"$SAGE_VERSION"'; date='"$SAGE_RELEASE_DATE"'" >> version.py
    58    cd $SAGE_ROOT/devel/sage
     58   cd "$SAGE_ROOT"/devel/sage
    5959   python setup.py install
    6060fi
    6161
    62 cd $SAGE_ROOT/local/bin/
     62cd "$SAGE_ROOT"/local/bin/
    6363echo "import sage.misc.banner; sage.misc.banner.banner()" | ./python > sage-banner
    6464
    6565cd "$CUR"
    6666
    67 cp $SAGE_ROOT/local/bin/sage-spkg $PKGDIR/base/
    68 cp $SAGE_ROOT/local/bin/sage-env  $PKGDIR/base/
    69 cp $SAGE_ROOT/local/bin/sage-make_relative $PKGDIR/base/
     67cp "$SAGE_ROOT"/local/bin/sage-spkg "$PKGDIR"/base/
     68cp "$SAGE_ROOT"/local/bin/sage-env "$PKGDIR"/base/
     69cp "$SAGE_ROOT"/local/bin/sage-make_relative "$PKGDIR"/base/
    7070
    7171TMP="/tmp/$TARGET"
    7272
    73 if [ -d $TMP ]; then
    74    rm -rf "$TMP"
     73rm -rf "$TMP"
     74mkdir "$TMP"
     75
     76# copy sage root repo over.  Cloning needs to be done in an empty
     77# directory, so we do this now.  The other sage repositories are dealt
     78# with later.
     79cd "$SAGE_ROOT"
     80
     81hg diff
     82hg status
     83hg tag "$SAGE_VERSION"
     84hg commit -m "$SAGE_VERSION"
     85
     86echo "Copying root repository..."
     87"$SAGE_ROOT"/sage --hg clone --pull . "$TMP"
     88
     89if [ $? -ne 0 ]; then
     90    echo "Error copying Sage root repository."
     91    exit 1
    7592fi
    7693
    77 mkdir $TMP
     94rm "$TMP"/.hg/hgrc
     95echo "Done copying root repository."
    7896
    79 cd $SAGE_ROOT
    80 cp -LRp Makefile *.txt *.sage sage ipythonrc $TMP/
    8197STD=standard
    82 mkdir $TMP/$PKGDIR
    83 mkdir $TMP/$PKGDIR/$STD
    8498# Put VERSION.txt in a directory available for download during the
    8599# update process.  (See sage-update.)
    86100cp -p VERSION.txt $TMP/$PKGDIR/$STD/
    87 cp -p $PKGDIR/$STD/deps $TMP/$PKGDIR/$STD/
    88 cp -p $PKGDIR/$STD/libdist_filelist $TMP/$PKGDIR/$STD/
    89 cp -p $PKGDIR/$STD/newest_version $TMP/$PKGDIR/$STD/
    90 cp -pr $PKGDIR/base $TMP/$PKGDIR/
    91 cp -p $PKGDIR/install $TMP/$PKGDIR/
    92 cp -p $PKGDIR/pipestatus $TMP/$PKGDIR/
    93 cp -p $PKGDIR/update $TMP/$PKGDIR/
    94 cp -p $PKGDIR/gen_html $TMP/$PKGDIR/
    95 cp -p $PKGDIR/README.txt $TMP/$PKGDIR/
     101cp -pr "$PKGDIR"/base "$TMP/$PKGDIR/"
    96102
    97 $SAGE_ROOT/local/bin/sage-make_devel_packages $SAGE_VERSION $SAGE_ROOT $TMP/devel
     103"$SAGE_ROOT"/local/bin/sage-make_devel_packages "$SAGE_VERSION" "$SAGE_ROOT" "$TMP"/devel
    98104
    99105if [ $? -ne 0 ]; then
    100106    echo "Error building the Sage packages."
    101107    exit 1
    102108fi
    103109
    104 cp $TMP/devel/*.spkg $SAGE_ROOT/$PKGDIR/$STD/
     110cp "$TMP"/devel/*.spkg "$SAGE_ROOT/$PKGDIR/$STD/"
    105111
    106 cp -p $PKGDIR/$STD/*.spkg $TMP/$PKGDIR/$STD/
    107 cp -p $PKGDIR/$STD/*.txt $TMP/$PKGDIR/$STD/
     112cp -p "$PKGDIR/$STD"/*.spkg "$TMP/$PKGDIR/$STD/"
    108113
    109 cd $TMP/$PKGDIR/$STD
     114cd "$TMP/$PKGDIR/$STD"
    110115rm -rf doc-* sage-* extcode-* sage_scripts-* examples-*
    111 mv $TMP/devel/*.spkg .
    112 rmdir $TMP/devel
     116mv "$TMP"/devel/*.spkg .
     117rmdir "$TMP"/devel
    113118
    114119cd /tmp
    115 tar cf $TARGET.tar $TARGET
     120tar cf "$TARGET".tar "$TARGET"
    116121
    117 if [ ! -d $SAGE_ROOT/dist ]; then
    118     mkdir $SAGE_ROOT/dist
    119 fi
     122mkdir -p "$SAGE_ROOT"/dist
    120123
    121 if [ -d $SAGE_ROOT/dist/$TARGET ]; then
    122     rm -rf "$SAGE_ROOT/dist/$TARGET"
    123 fi
     124rm -rf "$SAGE_ROOT/dist/$TARGET"
    124125
    125 mv $TARGET $SAGE_ROOT/dist/
    126 mv $TARGET.tar $SAGE_ROOT/dist/
     126mv "$TARGET" "$SAGE_ROOT"/dist/
     127mv "$TARGET".tar "$SAGE_ROOT"/dist/
  • sage-spkg-install

    diff -r e7a865848991 -r cd26ce8a6e0d sage-spkg-install
    a b  
    22
    33CUR=`pwd`
    44
    5 TARGET="$SAGE_ROOT"/local/bin/
     5TARGET="$SAGE_ROOT/local/bin/"
    66
    77if [ -d "$TARGET"/.hg ]; then
    88
    fi 
    2525# Finally, make sure some symbolic links exist.
    2626cd "$CUR"
    2727
    28 # These are not part of the scripts repo and are
    29 # not under revision control, so they get wacked (at least
    30 # we do save the last versions in tmp, just in case).
    31 TMP="$SAGE_ROOT"/tmp/
    32 if [ ! -d "$TMP" ]; then
    33     mkdir "$TMP"
    34 fi
    35 cp "$SAGE_ROOT"/sage-python "$TMP"/
    36 cp sage-python "$SAGE_ROOT"/
    37 
    38 cp "$SAGE_ROOT"/spkg/install "$TMP"/
    39 cp install "$SAGE_ROOT"/spkg/
    40 
    41 cp "$SAGE_ROOT"/*.txt "$TMP"/
    42 cp *.txt "$SAGE_ROOT"/
    43 
    44 rm -rf "$TMP"/ipython
    45 cp -r "$SAGE_ROOT"/ipython "$TMP"/
    46 cp -r ipython "$SAGE_ROOT/"
    47 
    4828# I think these below should moved to the relevant spkg's. 
    4929# -- William Stein (2007-10-04)
    5030cd "$TARGET"
    5131ln -sf python sage.bin
    5232ln -sf Singular sage_singular
    5333ln -sf gp sage_pari
    54 
  • sage-update

    diff -r e7a865848991 -r cd26ce8a6e0d sage-update
    a b import shutil 
    2020import sys
    2121import urllib
    2222from textwrap import fill
     23import subprocess
    2324
    2425
    2526# Figure out what the package server is, where we will download our
    def do_update(): 
    343344        print "Abort."
    344345        sys.exit(2)
    345346
     347    # check sage root repo.  if present, check status; if there are
     348    # any unchecked in changes, abort.
     349    os.chdir(SAGE_ROOT)
     350    err = subprocess.call('./sage -hg verify', shell=True,
     351                          stdout=subprocess.PIPE,
     352                          stderr=subprocess.PIPE)
     353    root_repo_intact = (err == 0)
     354    if root_repo_intact:
     355        P = subprocess.Popen('./sage -hg status', shell=True,
     356                             stdout=subprocess.PIPE)
     357        output = P.communicate()[0]
     358        if len(output) > 0: # uncommitted changes
     359            print ("There are uncommitted changes in the "
     360                   + "Sage root repository. Aborting.")
     361            sys.exit(2)
     362
     363    os.chdir(os.path.join(SPKG_ROOT, "standard"))
    346364    # Let's do it -- download everything.
    347365    for P in to_download:
    348366        # Note: don't use os.path.join when constructing arguments for
    def do_update(): 
    386404    download_file("standard/deps")
    387405    download_file("standard/newest_version")
    388406    os.system('chmod +x newest_version')
    389 
     407    # commit any changes into sage root repo.
     408    os.chdir(SAGE_ROOT)
     409    if root_repo_intact:
     410        for file in ['spkg/install',
     411                     'spkg/standard/deps',
     412                     'spkg/standard/newest_version']:
     413            subprocess.call('./sage -hg commit %s -m ' % file +
     414                            '"committing %s while running sage-update" ' % file +
     415                            '-u "Sage (during sage -upgrade)"',
     416                            shell=True)
    390417
    391418if __name__ == '__main__':
    392419    # Make sure the SAGE_ROOT variable is set.  This should always be