Changes between Version 16 and Version 17 of Ticket #5852


Ignore:
Timestamp:
08/19/11 17:34:35 (10 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5852 – Description

    v16 v17  
    1 Currently, {{{$SAGE_ROOT/sage}}} uses (first among other alternate methods) {{{readlink -n}}} to detect the directory where the script lives (that's $SAGE_ROOT), but it should use {{{readlink -nf}}} to expand symlinks recursively.
    2 
    3 Otherwise, the symlink expansion may not be completely done, and {{{$SAGE_ROOT}}} could end up with a non-canonical dirname, which leads to issues with testing.
     1Currently, {{{$SAGE_ROOT/sage}}} uses (first among other alternate methods) {{{readlink -n}}} to detect the directory where the script lives (that's $SAGE_ROOT), but that is broken because
     2 - It only works when `$0` (the sage executable itself) is a symbolic link
     3 - If the sage executable is a symbolic link, then `readlink -n` returns the link itself, not the canonicalized name.  Example: if `/usr/local/sage-4.7.1/sage` is a symbolic link to `sagefoo`, then `SAGE_ROOT` would become `sagefoo` when `'/usr/local/sage-4.7.1/sagefoo` is intended.
     4 - The symlink expansion may not be completely done, and {{{$SAGE_ROOT}}} could end up with a non-canonical dirname, which leads to issues with testing.
    45
    56Here's a way to reproduce an issue with the current script. For the example, my sage-3.4 installation lives in {{{/home/sage/sage-3.4}}}, and here's what happened to me:
     
    3738}}}
    3839
    39 Note that we should do this in a portable way, without using `realpath`, `readlink -f` or the likes.  See either #6146 or #11707 for a script which could be used for this.
     40Note that we should do this in a portable way, without using `realpath`, `readlink -f` or the likes.  See attachments for two bash scripts to solve this problem (either of them should suffice).