On Tue, Oct 13, 2009 at 7:00 AM, Ralf Hemmecke <r...@hemmecke.de> wrote: > > Hello, > > last night I got a real headache with "sage -sh" not just prepending to > my current path but rather resetting it... Anyway, I looked into sage > and sage-sage and sage-env and then wondered why in sage-env there > appears something like > > if [ "$SAGE_ROOT" = "" ]; then > if [ -f sage -a -d spkg ]; then > SAGE_ROOT="`pwd`" > export SAGE_ROOT > ... > > If the logic is that the only entry point to the local/bin scripts is > through the "sage" shell script then why would there be ever SAGE_ROOT > be unset (except in evil cases where someone removes it from the > environment)?
That is definitely not the case. The "sage -sh" command was a relatively recent addition to Sage, at least from my point of view. For most of my time working on Sage, when I wanted to setup the Sage environment variables, I typed . local/bin/sage-env It would be reasonable to discuss this issue here and *decide* that indeed we want the only way to use any script in local/bin to be through the SAGE_ROOT/sage script, in which case the lines if [ "$SAGE_ROOT" = "" ]; then if [ -f sage -a -d spkg ]; then SAGE_ROOT="`pwd`" export SAGE_ROOT would be replaced by if [ "$SAGE_ROOT" = "" ]; then ... error message ... > SAGE_ROOT is set in "sage" and exported. So what was the > intention? > > Further, I find > > . $SAGE_ROOT/local/bin/sage-env > > in sage-sage > > and > > $SAGE_ROOT/local/bin/sage-env > > (no dot at the beginning) in sage-build. That line in sage-build has no effect, so can be safely deleted. (It's been that way since I wrote the script in 2005.) Submit a patch. > Again, if the logic would be that the only entry point into sage is the > sage script then sage-env should be sourced in that script and every > other script inside $SAGE_ROOT/local/bin can assume that the environment > is OK. The environment would simply be inherited from the sage script. > > I must probably miss something, because otherwise the current logic > wouldn't be so complicated. > > Please pass on your knowledge so that the scripts can be cleaned up. > > Anyway, where is the hottest repository for these scripts? I've seen a > .hg dir under $SAGE_ROOT/local/bin, but of course that does not include > the "sage" script itself. If you want another pair of eyes going over > the latest scripts give me some pointers. The "hottest" repository is the one you saw. :-) The script $SAGE_ROOt/sage is not under revision control. William > > Thanks > Ralf > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---