Ticket #10176: sagenb-0.8.7_vs._0.8.7.p1.diff

File sagenb-0.8.7_vs._0.8.7.p1.diff, 4.1 KB (added by leif, 12 years ago)

Cumulative diff between SageNB 0.8.7 and 0.8.7.p1 - for reference / review only.

  • setup.py

    diff -r b68fd5956e6d -r cfcdef9e7a82 setup.py
    a b  
    2121   
    2222
    2323code = setup(name = 'sagenb',
    24       version     = '0.8.7',  # the spkg-dist script assumes single quotes here
     24      version     = '0.8.7.p1',  # the spkg-dist script assumes single quotes here
    2525      description = 'The Sage Notebook',
    2626      license     = 'GNU Public License (GPL) v2+',
    2727      author      = 'William Stein et al.',
  • spkg-dist

    diff -r b68fd5956e6d -r cfcdef9e7a82 spkg-dist
    a b  
    4242
    4343spkg_install = os.path.abspath(os.path.join(os.path.curdir, 'spkg-install'))
    4444spkg_install_fd = open(spkg_install, 'w')
    45 spkg_install_fd.write("cd src\n")
    4645
    4746shutil.copy(os.path.join(os.path.pardir, os.path.pardir, 'SPKG.txt'),
    4847            os.path.curdir)
     
    5150
    5251def fetch_packages():
    5352    # This block is here in case we ever need it again.
     53    # XXX Then also make sure the easy_install commands
     54    # XXX get written to the correct part of spkg-install!
     55    # XXX (We currently use a single string for the whole file.)
    5456    print "Fetching the required packages"
    5557    pkg_index = PackageIndex()
    5658
     
    7577
    7678os.chdir(os.path.pardir)
    7779
    78 spkg_install_fd.write("""
     80spkg_install_fd.write(
     81r"""#!/usr/bin/env bash
     82
     83# spkg-install for SageNB, generated by SageNB's spkg-dist
     84
     85if [ -z "$SAGE_LOCAL" ]; then
     86    echo "SAGE_LOCAL undefined - exiting..."
     87    exit 1
     88fi
     89
     90cd src
     91
    7992cd sagenb
    8093python setup.py install
     94if [ $? -ne 0 ]; then
     95    echo "Error running setup.py install"
     96    exit 1
     97fi
    8198
    8299mkdir -p "$SAGE_ROOT/devel"
    83100
    84101echo "Copying SageNB package to '$SAGE_ROOT/devel/sagenb-main'."
    85102if [ -d "$SAGE_ROOT/devel/sagenb-main" ]; then
    86   echo "Copying old SageNB package to '$SAGE_ROOT/devel/sagenb-main-old'."
    87   rm -rf "$SAGE_ROOT/devel/sagenb-main-old"
    88   cp -pr "$SAGE_ROOT/devel/sagenb-main" "$SAGE_ROOT/devel/sagenb-main-old"
     103    echo "Moving old SageNB package to '$SAGE_ROOT/devel/sagenb-main-old'."
     104    rm -rf "$SAGE_ROOT/devel/sagenb-main-old"
     105    mv "$SAGE_ROOT/devel/sagenb-main" "$SAGE_ROOT/devel/sagenb-main-old"
    89106fi
    90107
    91 rm -f "$SAGE_ROOT/devel/sagenb"
     108# Rather than copying, we now use 'mv' above, so nothing to delete here:
     109# rm -rf "$SAGE_ROOT/devel/sagenb" # Should point to sagenb-main if it exists
    92110
    93111cd ..
    94112cp -pr sagenb "$SAGE_ROOT/devel/sagenb-main"
     
    99117# We use relative paths for relocatability.
    100118cd "$SAGE_ROOT/devel/sagenb"
    101119python setup.py develop --egg-path ../../../../devel/sagenb
     120if [ $? -ne 0 ]; then
     121    echo "Error running setup.py develop"
     122    exit 1
     123fi
    102124
    103125cd "$SAGE_ROOT/local/lib/python/site-packages"
    104 sed 's/^.*sagenb.*$/..\/..\/..\/..\/devel\/sagenb/' easy-install.pth > easy-install.pth.new
    105 mv -f easy-install.pth.new easy-install.pth
     126# Dave says Solaris' non-POSIX grep in the default path
     127# doesn't understand "-q" (which *is* POSIX):
     128if ! grep sagenb easy-install.pth >/dev/null; then
     129    # Ugly work-around, we haven't found the real cause yet (see #10176):
     130    echo 'No sagenb path found in easy-install.pth!'
     131    echo "Adding relative sagenb path to easy-install.pth"
     132    sed -e '$ i \../../../../devel/sagenb' easy-install.pth > easy-install.pth.$$
     133    if [ $? -ne 0 ]; then
     134        echo "Error adding relative sagenb path to easy-install.pth"
     135        exit 1
     136    fi
     137else
     138    echo "Making sagenb path in easy-install.pth relative"
     139    sed 's/^.*sagenb.*$/..\/..\/..\/..\/devel\/sagenb/' easy-install.pth > easy-install.pth.$$
     140    if [ $? -ne 0 ]; then
     141        echo "Error patching easy-install.pth to have relative path to SageNB"
     142        exit 1
     143    fi
     144fi
     145if true; then # DEBUG (cf. #10176)
     146    echo "Old path: \"`grep sagenb easy-install.pth`\""
     147    echo "New path: \"`grep sagenb easy-install.pth.$$`\""
     148fi
     149# The following fails only on wrong file permissions etc.:
     150mv -f easy-install.pth.$$ easy-install.pth
     151if [ $? -ne 0 ]; then
     152    echo "Error overwriting original easy-install.pth"
     153    exit 1
     154fi
    106155""")
    107156spkg_install_fd.close()
    108157os.chmod(spkg_install, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP |