#11707: Remove `readlink -n` and `realpath` from $SAGE_ROOT/sage
------------------------+---------------------------------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-4.7.2
Component: scripts | Keywords: SAGE_ROOT
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
------------------------+---------------------------------------------------
The file `$SAGE_ROOT/sage' contains the lines
{{{
if [ "$SAGE_ROOT" = "....." ]; then
SAGE_ROOT=`readlink -n "$0" 2> /dev/null` || \
SAGE_ROOT=`realpath "$0" 2> /dev/null` || \
SAGE_ROOT="$0"
}}}
However, `readlink -n` certainly does not do what is intended:
- It only works when `$0` (the sage executable itself) is a symbolic link
- 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.
Maybe, the whole `readlink`/`realpath` logic should be removed.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11707>
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.