#12627: The spkg/bin/sage script engraves paths to executables
--------------------------------+-------------------------------------------
Reporter: Snark | Owner: leif
Type: defect | Status: needs_info
Priority: major | Milestone: sage-5.0
Component: scripts | Resolution:
Keywords: rd2 | Work issues:
Report Upstream: N/A | Reviewers: R. Andrew Ohana
Authors: Julien Puydt | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Comment (by leif):
How about introducing `SAGE_BINARIES_PATH`? (to be optionally set by the
user; containing a colon-separated list of directories to search for
''Sage'' programs and scripts)
(`sage-env` would probably ''pre''pend e.g. `"$SAGE_LOCAL/bin:"` if
`SAGE_BINARIES_PATH` is non-empty, otherwise set it to the former.)
Then we could use (logically)
{{{
#!sh
PATH="$SAGE_BINARIES_PATH" command -v FOO >/dev/null || echo "Sage's FOO
is not installed..."
}}}
or
{{{
#!sh
PATH="$SAGE_BINARIES_PATH" command FOO
# exit status 127 would (usually) tell that FOO wasn't found (along
$SAGE_BINARIES_PATH)
}}}
and similar.
A potential problem being that FOO would inherit the modified `PATH` in
the second example; we could therefore also use
{{{
#!sh
prog=`PATH="$SAGE_BINARIES_PATH" command -v FOO`
if [[ -z $prog ]]; then
# FOO isn't installed anywhere along $SAGE_BINARIES_PATH
else
# found; for example run FOO:
$prog
fi
}}}
[[BR]]
Better names appreciated. `SAGE_PATH` is unfortunately already used for a
slightly different purpose.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12627#comment:24>
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.