Changes between Version 17 and Version 23 of Ticket #5852


Ignore:
Timestamp:
08/23/11 13:18:22 (10 years ago)
Author:
jdemeyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5852

    • Property Status changed from reopened to needs_review
    • Property Authors changed from to Jeroen Demeyer
    • Property Cc leif added
    • Property Summary changed from The detection of SAGE_ROOT in $SAGE_ROOT/sage script should expand symlinks recursively to The detection of SAGE_ROOT in $SAGE_ROOT/sage and local/bin/sage-env should expand symlinks recursively
    • Property Owner changed from tornaria to jdemeyer
  • Ticket #5852 – Description

    v17 v23  
    44 - 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.
    55
    6 Here'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:
    7 {{{
    8 /home/sage$ md5sum sage-3.4/sage
    9 4153919efe1edcd34ad7fa193122d679  sage-3.4/sage
    10 /home/sage$ ln -s sage-3.4 sage-3.4-symlink
    11 /home/sage$ ln -sf /home/sage/sage-3.4-symlink/sage /home/tornaria/bin/sage
    12 /home/sage$ type sage
    13 sage is hashed (/home/tornaria/bin/sage)
    14 /home/sage$ readlink `type -p sage`
    15 /home/sage/sage-3.4-symlink/sage
    16 /home/sage$ readlink -f `type -p sage`
    17 /home/sage/sage-3.4/sage
    18 }}}
     6Note 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).
    197
    20 As you can see, {{{readlink -n}}} expands once but doesn't cannonicalize the path to the {{{sage}}} script. And here's the symptom:
    21 {{{
    22 /home/sage$ sage -t sage-3.4/devel/sage-main/sage/all.py
    23 sage -t  "sage-3.4/devel/sage-main/sage/all.py"             
    24   File "./all.py", line 18
    25     from sage-3.4/devel/sage-main/sage/all import *
    26              ^
    27 SyntaxError: invalid syntax
    28 
    29          [0.3 s]
    30 exit code: 1024
    31  
    32 ----------------------------------------------------------------------
    33 The following tests failed:
    34 
    35 
    36         sage -t  "sage-3.4/devel/sage-main/sage/all.py"
    37 Total time for all tests: 0.3 seconds
    38 }}}
    39 
    40 Note 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).
     8Apply:
     9 1. [attachment:5852_sage_root.patch] to `SAGE_ROOT`
     10 1. [attachment:5852_scripts.patch] to `local/bin`