#10192: SageNB fails to install when SAGE_PATH is set to '.'
------------------------------+---------------------------------------------
Reporter: hivert | Owner: jason, was
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7.2
Component: build | Keywords: notebook installation dot
PYTHONPATH easy_install easy-install pth sage-spkg setuptools
Work_issues: | Upstream: N/A
Reviewer: Florent Hivert | Author: Leif Leonhardy
Merged: | Dependencies:
------------------------------+---------------------------------------------
Comment(by ppurka):
Replying to [comment:13 leif]:
> And what's the advantage of running `sed` (and twice `test`, and `echo`)
multiple times in a loop? B)
>
> I'm not sure right now whether my patch is up-to-date btw., as the
currently attached one doesn't remove redundant slashs and (e.g.) `./`...
8/
The main point in the patch is the separator that is redefined to ':'.
Now when you run a loop through the variable, it loops through all the
parts separated by ':'. Once each part is separated, you can check whether
it is empty (hence the first test `-n "$x"`), or whether it consists of
only . and / (hence the echo + sed). This is important because this
catches all the bad cases like `..`, `./.`, `.`, etc. ( In relation to
#11914, I tried to cd to devel/sage/sage and ran sage as `SAGE_PATH=..
sage -n` and it failed to run. So we should definitely weed out at least
`..` by itself. ) I do feel that it is over-engineered, but I haven't been
able to come up with a better solution that catches all the cases.
Since all the scripts in Sage are trying to conform to POSIX you need the
echo + sed. In pure bash, you can replace the `"$( echo "$x" | sed ... )"`
with simply `"${x//[\.\/]}"`
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10192#comment:14>
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.