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 , 12 years ago) |
---|
-
setup.py
diff -r b68fd5956e6d -r cfcdef9e7a82 setup.py
a b 21 21 22 22 23 23 code = setup(name = 'sagenb', 24 version = '0.8.7 ', # the spkg-dist script assumes single quotes here24 version = '0.8.7.p1', # the spkg-dist script assumes single quotes here 25 25 description = 'The Sage Notebook', 26 26 license = 'GNU Public License (GPL) v2+', 27 27 author = 'William Stein et al.', -
spkg-dist
diff -r b68fd5956e6d -r cfcdef9e7a82 spkg-dist
a b 42 42 43 43 spkg_install = os.path.abspath(os.path.join(os.path.curdir, 'spkg-install')) 44 44 spkg_install_fd = open(spkg_install, 'w') 45 spkg_install_fd.write("cd src\n")46 45 47 46 shutil.copy(os.path.join(os.path.pardir, os.path.pardir, 'SPKG.txt'), 48 47 os.path.curdir) … … 51 50 52 51 def fetch_packages(): 53 52 # 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.) 54 56 print "Fetching the required packages" 55 57 pkg_index = PackageIndex() 56 58 … … 75 77 76 78 os.chdir(os.path.pardir) 77 79 78 spkg_install_fd.write(""" 80 spkg_install_fd.write( 81 r"""#!/usr/bin/env bash 82 83 # spkg-install for SageNB, generated by SageNB's spkg-dist 84 85 if [ -z "$SAGE_LOCAL" ]; then 86 echo "SAGE_LOCAL undefined - exiting..." 87 exit 1 88 fi 89 90 cd src 91 79 92 cd sagenb 80 93 python setup.py install 94 if [ $? -ne 0 ]; then 95 echo "Error running setup.py install" 96 exit 1 97 fi 81 98 82 99 mkdir -p "$SAGE_ROOT/devel" 83 100 84 101 echo "Copying SageNB package to '$SAGE_ROOT/devel/sagenb-main'." 85 102 if [ -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" 89 106 fi 90 107 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 92 110 93 111 cd .. 94 112 cp -pr sagenb "$SAGE_ROOT/devel/sagenb-main" … … 99 117 # We use relative paths for relocatability. 100 118 cd "$SAGE_ROOT/devel/sagenb" 101 119 python setup.py develop --egg-path ../../../../devel/sagenb 120 if [ $? -ne 0 ]; then 121 echo "Error running setup.py develop" 122 exit 1 123 fi 102 124 103 125 cd "$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): 128 if ! 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 137 else 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 144 fi 145 if true; then # DEBUG (cf. #10176) 146 echo "Old path: \"`grep sagenb easy-install.pth`\"" 147 echo "New path: \"`grep sagenb easy-install.pth.$$`\"" 148 fi 149 # The following fails only on wrong file permissions etc.: 150 mv -f easy-install.pth.$$ easy-install.pth 151 if [ $? -ne 0 ]; then 152 echo "Error overwriting original easy-install.pth" 153 exit 1 154 fi 106 155 """) 107 156 spkg_install_fd.close() 108 157 os.chmod(spkg_install, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP |