Ticket #9433: trac_9433-scripts.v2.patch

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

fixes problems found by mpatel. apply to scripts repo

  • sage-bdist

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1285348336 25200
    # Node ID a16344ddbfea0ccdafd1298d60fb9cafe677ecac
    # Parent  1d4069549ee00b45cf5d4e4d852fbff8716c1e97
    #9433: put more files under revision control
    
    diff -r 1d4069549ee0 -r a16344ddbfea sage-bdist
    a b fi 
    4242
    4343mkdir "$TMP"
    4444
     45# copy sage root repo over:
     46cd $SAGE_ROOT
     47
     48echo "Copying root repository..."
     49$SAGE_ROOT/sage --hg clone --pull . $TMP
     50
     51if [ $? -ne 0 ]; then
     52    echo "Error copying sage root repository."
     53    exit 1
     54fi
     55
     56rm $TMP/.hg/hgrc
     57echo "Done copying root repository."
     58
    4559cd "$SAGE_ROOT"
    4660
    4761echo "Copying files over to tmp directory"
    48 cp -$OPT examples local makefile *.txt *.sage sage ipython data "$TMP"/
     62cp -$OPT examples local data "$TMP"/
    4963
    5064if [ -d devel/sage-main ]; then
    5165   echo "Copying Sage library over"
    cd "$SAGE_ROOT" 
    6680if [ -d $PKGDIR ]; then
    6781   echo "Making empty spkg's"
    6882   cd $PKGDIR
    69    mkdir $TMP/$PKGDIR
    7083   mkdir $TMP/$PKGDIR/build
    7184   mkdir $TMP/$PKGDIR/optional
    7285   cp -$OPT installed $TMP/$PKGDIR/
    7386   cp -$OPT standard $TMP/$PKGDIR/
    74    cp  install README.txt gen_html $TMP/$PKGDIR/
    7587   cd $TMP/$PKGDIR/standard/
    7688   for F in `/bin/ls *.spkg`; do
    7789       echo "Placeholder spkg file so this binary version of Sage knows this package version used when installing Sage." > $F
    if [ "$UNAME" = "Darwin" ]; then 
    8395    cd "$TARGET"
    8496    mkdir x
    8597    echo "There will be an error about x below that you can safely ignore."
    86     mv * x
     98    mv * .hg* x
    8799    mv x sage
    88100    cp sage/local/bin/sage-README-osx.txt README.txt
    89101
  • sage-make_devel_packages

    diff -r 1d4069549ee0 -r a16344ddbfea sage-make_devel_packages
    a b 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/
    chmod -x sage-maxima.lisp sage-verify-py 
    141142rm sage-*~
    142143
    143144cp -pr sage-* .hg* ipy_profile_sage.py $SCRIPTS/
    144 cp -p $SAGE_ROOT/sage-python $SCRIPTS/
    145 cp -p $SAGE_ROOT/*.txt $SCRIPTS/
    146 cp -pr $SAGE_ROOT/ipython $SCRIPTS/
    147 cp -p $SAGE_ROOT/spkg/install $SCRIPTS/
    148145cp -p $SAGE_ROOT/local/bin/sage-spkg-install $SCRIPTS/spkg-install
    149146cp -p $SAGE_ROOT/local/bin/SbuildHack.pm $SCRIPTS/
    150147cp -p $SAGE_ROOT/local/bin/ncadoctest.py $SCRIPTS/
    if [ ! -f $PKG/sage_scripts-$SAGE_VERSIO 
    160157    echo "The package sage_scripts-$SAGE_VERSION.spkg wasn't created."
    161158    exit 1
    162159fi
     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 1d4069549ee0 -r a16344ddbfea sage-sdist
    a b fi 
    4848
    4949mkdir $TMP
    5050
     51# copy sage root repo over.  Cloning needs to be done in an empty
     52# directory, so we do this now.  The other sage repositories are dealt
     53# with later.
    5154cd $SAGE_ROOT
    52 cp -LRp makefile *.txt *.sage sage ipythonrc $TMP/
     55
     56hg diff
     57hg status
     58hg tag "$SAGE_VERSION"
     59hg commit -m "$SAGE_VERSION"
     60
     61echo "Copying root repository..."
     62$SAGE_ROOT/sage --hg clone --pull . $TMP
     63
     64if [ $? -ne 0 ]; then
     65    echo "Error copying sage root repository."
     66    exit 1
     67fi
     68
     69rm $TMP/.hg/hgrc
     70echo "Done copying root repository."
     71
    5372STD=standard
    54 mkdir $TMP/$PKGDIR
    55 mkdir $TMP/$PKGDIR/$STD
    56 cp -p $PKGDIR/$STD/deps $TMP/$PKGDIR/$STD/
    57 cp -p $PKGDIR/$STD/libdist_filelist $TMP/$PKGDIR/$STD/
    58 cp -p $PKGDIR/$STD/newest_version $TMP/$PKGDIR/$STD/
    5973cp -pr $PKGDIR/base $TMP/$PKGDIR/
    60 cp -p $PKGDIR/install $TMP/$PKGDIR/
    61 cp -p $PKGDIR/pipestatus $TMP/$PKGDIR/
    62 cp -p $PKGDIR/update $TMP/$PKGDIR/
    63 cp -p $PKGDIR/gen_html $TMP/$PKGDIR/
    64 cp -p $PKGDIR/README.txt $TMP/$PKGDIR/
    6574
    6675$SAGE_ROOT/local/bin/sage-make_devel_packages $SAGE_VERSION $SAGE_ROOT $TMP/devel
    6776
    fi 
    7382cp $TMP/devel/*.spkg $SAGE_ROOT/$PKGDIR/$STD/
    7483
    7584cp -p $PKGDIR/$STD/*.spkg $TMP/$PKGDIR/$STD/
    76 cp -p $PKGDIR/$STD/*.txt $TMP/$PKGDIR/$STD/
    7785
    7886cd $TMP/$PKGDIR/$STD
    7987rm -rf doc-* sage-* extcode-* sage_scripts-* examples-*
  • sage-spkg-install

    diff -r 1d4069549ee0 -r a16344ddbfea sage-spkg-install
    a b 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 1d4069549ee0 -r a16344ddbfea sage-update
    a b def do_update(): 
    307307    for P in to_download:
    308308        download_file("standard/%s" % P)
    309309
    310     # Download these since the build system requires them to be
    311     # updated or we can't build correctly.
    312     os.chdir(SPKG_ROOT)
    313     download_file("install")
    314     os.system('chmod +x install')
    315     os.chdir("%s/standard/" % SPKG_ROOT)
    316     download_file("standard/deps")
    317     download_file("standard/newest_version")
    318     os.system('chmod +x newest_version')
    319 
    320310
    321311if __name__ == '__main__':
    322312    # Make sure the SAGE_ROOT variable is set.  This should always be
  • sage-upgrade

    diff -r 1d4069549ee0 -r a16344ddbfea sage-upgrade
    a b if [ $ERR -ne 0 ]; then 
    2222fi
    2323
    2424# Got all new packages, and ready to go.  Now actually do the install.
     25# First install the sage_root repo, then run the install script to do
     26# the others.
    2527cd $SAGE_ROOT/spkg/
     28newest="$SAGE_ROOT/spkg/standard/newest_version"
     29ROOT_REPO=`$newest sage_root`
     30
     31echo $ROOT_REPO
     32
     33./pipestatus "sage-spkg $ROOT_REPO 2>&1" "tee -a $SAGE_ROOT/spkg/logs/$ROOT_REPO.log"
    2634
    2735./install
    2836
    if [ $? -ne 0 ]; then 
    3139    echo "Error installing Sage!"
    3240    exit 1
    3341fi
    34