#5852: Properly canonicalize $SAGE_ROOT
-------------------------------+--------------------------------------------
    Reporter:  tornaria        |         Owner:  jdemeyer    
        Type:  defect          |        Status:  needs_review
    Priority:  major           |     Milestone:  sage-4.7.3  
   Component:  scripts         |    Resolution:              
    Keywords:                  |   Work_issues:              
    Upstream:  N/A             |      Reviewer:              
      Author:  Jeroen Demeyer  |        Merged:              
Dependencies:                  |  
-------------------------------+--------------------------------------------

Comment(by leif):

 Replying to [comment:32 jdemeyer]:
 > Replying to [comment:31 leif]:
 > > What sense does it make to first call `resolvelinks()` and then
 finally do
 {{{
 #!sh
 SAGE_ROOT=`cd "$SAGE_ROOT" && pwd -P`
 }}}
 > > ?
 > Because `resolvelinks` resolves symbolic links in the `sage` executable
 name, which is not a directory (so the `cd && pwd` trick does not work).

 Of course it does.  You just have to
  * strip the program name, and
  * if no path remains after that, it's the current working directory, i.e.
 path=".".
  * `cd` to that path and do `pwd -P`.  Doesn't matter whether the path was
 relative or absolute.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5852#comment:33>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to