-
Notifications
You must be signed in to change notification settings - Fork 19
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
Asking for guidance for making EUPS relocatable #23
Comments
@CraigLoomis, EUPS guru, writes:
|
@airnandez : These seem reasonable to me. The only thing I'd propose is not to do the command line parameter, but just use the environmental variable for EUPS_PATH. We already have precedent for deferring to the environment, though this may theoretically break someone's code if they rely on setups.sh overwriting whatever they had in EUPS_PATH. |
I don't know how to get the value of the directory where a sourced script is found (bash uses $BASH_SOURCE, but that's an extension). What are you proposing? I'm OK with changing all the setups scripts (or more precisely the script mksetup that writes them) to obey a pre-existing EUPS_DIR variable rather than setting it absolutely. If you want to hack setting EUPS_DIR into the loadLSST.sh (and .csh and any others that people have written) that's OK with me; I never use it.
You need to do this in the opposite order, as setups.sh adds the configured path to your EUPS_PATH. That is:
As Mario notes, as corrected this is the correct answer for EUPS_PATH rather than adding a new command line option. The solution that works out of the box, and how this is supposed to work, is:
|
Thanks for your feedback. To get the path of the shell script within the script itself I use Would this assumption hold for the contexts where EUPS is used? If so, we could go ahead and implement my proposed modifications. If not, EUPS' By the way, I would also like to suggest that |
You cannot assume that
See also https://wiki.ubuntu.com/DashAsBinSh |
No, it needs to work with a posix shell
I'm willing to accept a patch that does that.
It generates setups.sh (which should work for bash, sh, and ksh), setups.csh ([t]csh), and setups.zsh (zsh/dash, but I think I can make setups.sh work for them too when I fix the ksh problems). I don't think we need distinguish beyond bourne-shell and csh-shell variants.
|
I will work on a patch to I will send you a pull request then when my proposed modification is ready for reviewing. |
I know it's been two years, but did this get fixed all on its own? |
Not that I know of |
Dear EUPS experts,
I'm working towards helping making the LSST stack relocatable. Since EUPS is an essential ingredient of the LSST stack, we need to make EUPS itself relocatable. Before I spend more time coding and testing I would like to get some feedback on how the relocation could be implemented. Here are my understanding and the foreseen ways of making progress.
Among other things, the setup scripts
$EUPS_DIR/bin/setups.*sh
initialize 2 environment variables:EUPS_DIR
andEUPS_PATH
. The value set toEUPS_DIR
is the directory where EUPS is installed (option--prefix
passed toconfigure
).EUPS_PATH
is set to the value of the option--with-eups
passed toconfigure
. So, currently, the value of those two variables are set at installation time, which make relocating EUPS difficult.The purpose of the modification is to set those two environment variables with sensible values at execution time. The value
EUPS_DIR
can be set according to the directory where the scripts$EUPS_DIR/bin/setups.*sh
are located and this can be obtained at execution time.The value of
EUPS_PATH
cannot be automatically set to a sensible value at execution time. My idea is to modify each one of the shell scripts in$EUPS_DIR/bin/setups.*sh
so that they accept an optional command line argument which value would be appended to the current value of the environment variableEUPS_PATH
(if set), overwriting the default value. The default value forEUPS_PATH
would be set to the value of--with-eups
passed toconfigure
at installation time. In this way,loadLSST.sh
would setup EUPS by calling:or, alternatively
These 2 proposed modifications would both keep backwards compatibility.
Since I'm not an expert in EUPS nor familiar with the various contexts it may be used, I very likely don't see scenarios where the proposed way of working could fail or be incompatible with the way EUPS is currently used. So your feedback on this would be very appreciated: if these proposed modifications are considered useful, I would proceed doing the coding and eventually sending a pull request for you to review.
The text was updated successfully, but these errors were encountered: