Closed WesleyAC closed 11 years ago
We could also consider "overwriting" it for the duration of shell usage by having RED_SPIDER_ROOT/bin/ come before /bin/ in rsshell's PATH variable (I think) but I'm not sure how to do this
Actually $RED_SPIDER_ROOT/bin
is already prepended to PATH
, so if you're running fortune
from within rsshell
you should get the RSP version. :-)
Could you check that, @WesleyAC?
@jgonggrijp, nope. Running fortune from rsshell
gets me the unix version.
What if we take this as an opportunity to have the shell be a little more intelligent? I suggest the following changes:
rsshell cmd -flags
from anywhere should be identical to
calling rsshell; cmd -flags; exit
, where ; represents running the
command, for a not broken alternative to the last suggestion.@WesleyAC what if you first do chmod +x $RED_SPIDER_ROOT/bin/fortune
?
@jgonggrijp It works if I chmod +x first. Should setup.py chmod +x $RED_SPIDER_ROOT/bin/* by default?
Perhaps. So far setup.py
was just assuming that the executable_scripts
in /bin
already had the execution bit set and so far fortune
seems to have been the only (stubborn) exception. I just put it back again on the master branch. But perhaps it's unreasonable to make this assumption and then yes, setup.py
should do it (on unixy systems).
Do you think the assumption that executable_scripts
have the execution bit set is reasonable?
I'm going to go with no, because it will get messy with copies to and from flashdrives and other such media and between OSes. Better to have the setup assume nothing. If it resets the bit nothing bad happens. If it forgets to set the bit then ugly
I agree with @firerogue, it's better to set it twice than not all.
Done. Python's os.chmod
is a bit cumbersome because it doesn't let you just update one bit (you have (re)set all of them) so setup.py
will only touch the permissions if a script in /bin
is not executable.
I was testing all of the commands, and found that fortune on my system runs
/bin/fortune
as opposed toRED_SPIDER_ROOT/bin/fortune
.Sadly, the only way to fix this would be to rename
fortune
to something else. Perhapsxkcd-fortune
?Is it worth the rename to fix this for the (probably small) number of users who have
fortune
installed?