Ticket #10192: trac_10192-remove_dot_from_PYTHONPATH_in_sage-spkg.rebased_to_4.7.1.rc2.scripts.patch

File trac_10192-remove_dot_from_PYTHONPATH_in_sage-spkg.rebased_to_4.7.1.rc2.scripts.patch, 1.2 KB (added by leif, 7 years ago)

SCRIPTS repo. Same patch, rebased to Sage 4.7.1.rc2.

  • sage-spkg

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1288487180 -3600
    # Node ID 65a39d666a742040f5d912e33d093b9ff836bb60
    # Parent  9bfb3d088a9f591eb4d23aa12ec788ac9217b2b7
    #10192 sage-spkg: Remove '.' (current directory) from PYTHONPATH before installing an spkg (cf. also #10176)
    
    diff -r 9bfb3d088a9f -r 65a39d666a74 sage-spkg
    a b  
    304304
    305305chmod +x spkg-install
    306306
     307# Remove '.' from PYTHONPATH, which may also come from SAGE_PATH, to avoid
     308# trouble with setuptools / easy_install (cf. #10192, #10176):
     309if [ -n "$PYTHONPATH" ]; then
     310    # We also remove leading, trailing and redundant ':'s:
     311    new_pp=`echo "$PYTHONPATH" | sed -e 's/^://' -e 's/:$//' -e 's/::/:/g' \
     312        -e 's/^\.://' -e 's/:\.$//' -e 's/:\.:/:/g'`
     313    if [ "$PYTHONPATH" != "$new_pp" ]; then
     314        echo "Cleaning up PYTHONPATH:"
     315        echo "  Old: \"$PYTHONPATH\""
     316        echo "  New: \"$new_pp\""
     317        PYTHONPATH=$new_pp
     318        export PYTHONPATH # maybe redundant, but in any case safe
     319    fi
     320fi
     321
    307322# this is just wrong... (so don't do it)
    308323#echo "TOUCHING"
    309324#touch * */* */*/* */*/*/* 1>/dev/null 2>/dev/null