When networks use automounting to mount
directories upon demand by a user, the absolute
full path of a file commonly looks like

  /tmp_mnt/home/kate/..../filename
  /.automount/home/kate/.../filename
  /.autofs/home/kate/.../filename

while all the user normally sees is

  /home/kate/..../filename

This "automount prefix" can actually be
set by the system administrator, and so could
potentially be anything.

Now

    spkg/standard/sage_scripts-2.5/sage-test

calls os.path.abspath, which returns
the absolute path.  This causes 'make test'
to fail for me on automounted file systems,
but not on simply mounted file systems.

A fix is

def strip_automount_prefix(filename):
    str = filename.split("/",2)
    new = "/" + str[2]
    if os.path.exists(new):
        inode1 = os.stat(filename)[1]
        inode2 = os.stat(new)[1]
        if inode1 == inode2:
            filename = new
    return filename

and then "wrap" each of the three
instances of os.path.abspath in sage-test with
strip_automount_prefix; i.e,

  strip_automount_prefix(os.path.abspath(filename)).

When I do this, 'make test' now finishes
with no problems.

os.path.abspath is also used in other
sage scripts:

    sage-doctest
    sage-libdist
    sage-location

but either they do not cause a problem
or I have not stumbled over a problem yet.

If someone knows of a better fix, I would
be interested in hearing about it.

-- 
Kate Minola
University of Maryland, College Park

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to