Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: make EUPS independent of $SHELL #8

Merged
merged 1 commit into from
Feb 19, 2014

Conversation

mjuric
Copy link
Collaborator

@mjuric mjuric commented Feb 15, 2014

Before this patch, EUPS detected the shell it's running under by inspecting
the SHELL environment variable. This is incorrect, since SHELL will point to
the login shell, and not the most recently run shell. This leads to errors
when a user starts a different shell w/o manually resetting the SHELL
variable; e.g.:

$ echo $SHELL
/bin/tcsh
$ bash
bash-3.2$ source bin/setups.csh
bash-3.2$ setup some_package
bash: setenv: command not found

This patch makes EUPS look for EUPS_SHELL environment variable, which is
defined in setups.[sh|csh|zsh] scripts. Since the knowledge of the running
shell is needed to support the setup/unsetup aliases, by defining EUPS_SHELL
in the same scripts the two cannot get out of sync.

Before this patch, EUPS detected the shell it's running under by inspecting
the SHELL environment variable. This is incorrect, since SHELL will point to
the *login* shell, and not the most recently run shell. This leads to errors
when a user starts a different shell w/o manually resetting the SHELL
variable; e.g.:

    $ echo $SHELL
    /bin/tcsh
    $ bash
    bash-3.2$ source bin/setups.csh
    bash-3.2$ setup some_package
    bash: setenv: command not found

This patch makes EUPS look for EUPS_SHELL environment variable, which is
defined in setups.[sh|csh|zsh] scripts.  Since the knowledge of the running
shell is needed to support the setup/unsetup aliases, by defining EUPS_SHELL
in the same scripts the two cannot get out of sync.
RobertLuptonTheGood added a commit that referenced this pull request Feb 19, 2014
Use $EUPS_SHELL (not $SHELL) environment variable, and set it in setup.*

This avoids problems when people exec shells but don't reset SHELL
@RobertLuptonTheGood RobertLuptonTheGood merged commit cb8f8d6 into RobertLuptonTheGood:master Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants