Ticket #10469: trac_10469-sage-repo.patch

File trac_10469-sage-repo.patch, 1.2 KB (added by jhpalmieri, 11 years ago)

main Sage repo

  • sage/misc/dist.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1301268806 25200
    # Node ID 556efbcc299cbb21c54c4428e28505d1a5245ed4
    # Parent  ee957588e8a9834ab44b60c5f5483010a90e5e21
    #10469: resolve links in sage.misc.dist.install_scripts
    
    diff -r ee957588e8a9 -r 556efbcc299c sage/misc/dist.py
    a b  
    6363              'mwrank', 'ipython', 'hg', 'R']:
    6464        print "Checking that Sage has the command '%s' installed"%c
    6565        p = Popen(['which', c], stdout=PIPE, stderr=PIPE)
    66         path = p.communicate()[0].rstrip("\n")
     66        path = os.path.realpath(p.communicate()[0].rstrip("\n"))
    6767        error = p.wait()
    6868        if error:
    6969            # the 'which' command came up empty:
    7070            print "The command '%s' is not available; not adding shortcut"%c
    71         elif not path.startswith(os.environ['SAGE_ROOT']):
     71        elif not path.startswith(os.path.realpath(os.environ['SAGE_ROOT'])):
    7272            # 'which' returned a path outside of the Sage directory:
    7373            # then the command is already installed, and we shouldn't
    7474            # install the Sage version: