Created attachment 337113 [details] Patch for src/scripts/R.sh.in (found in R-2.8.1-7.fc10.src.rpm in the expanded R-2.8.1.tar.gz) Description of problem: R-core-2.8.1-7.fc10.x86_64 was installed by yum-updatesd. There are new files: /etc/profile.d/R.sh /etc/profile.d/R.csh If environment variable R_HOME is already set to a value other than the value used by R, then `R RHOME` produces a warning: $ R RHOME WARNING: ignoring environment value of R_HOME /usr/lib64/R The result is that the setting of R_HOME in /etc/profile.d/R.sh and /etc/profile.d/R.csh gets a wrong value (in case of bash) or produces a syntax error from setenv (in case of tcsh (csh)). In case of tcsh (csh) the syntax error stops the execution of the remaining init scripts, which results in an incomplete environment and settings of the tcsh (login) shell. Here are some results. Note that the value of R_HOME is "WARNING: ignoring environment value of R_HOME /usr/lib64/R" in the error case, and in tcsh "setenv R_HOME WARNING: ignoring environment value of R_HOME /usr/lib64/R" procudes a syntax error. $ bash $ export R_HOME= $ bash $ echo $R_HOME /usr/lib64/R $ exit $ export R_HOME=/usr/local/lib/R $ bash $ echo $R_HOME WARNING: ignoring environment value of R_HOME /usr/lib64/R $ exit $ export R_HOME=/usr/lib64/R $ bash $ echo $R_HOME /usr/lib64/R $ exit $ tcsh tcsh$ exit exit $ export R_HOME=/usr/local/lib/R $ tcsh setenv: Too many arguments. tcsh-incomplete $ exit How could this be solved? 1. The init scripts /etc/profile.d/R.sh and /etc/profile.d/R.csh should not set R_HOME is it is already set because it may be that the user has set it on his own. 2. R should write warning messages to standard error and not to standard output. The waring message listed above is written to standard output. Then `R RHOME` returns only the path and not also the error message. Version-Release number of selected component (if applicable): R-core-2.8.1-7.fc10.x86_64 How reproducible: Steps to Reproduce: See above. Additional info: This bug breaks login environment with tcsh as login shell and R_HOME already set. This is the reason why I declare the severity as high and why this bug should be fixed very soon. I provide patches which can be applied to the rpm sources so a new package can be build and released very soon. For the future I request the developers to consider and to test all possible standard cases (like the case that a variable is already set) before releasing an script (such as an init script) to the public. Thanks in advance!
Created attachment 337114 [details] Patch for /etc/profile.d/R.sh (found in R-2.8.1-7.fc10.src.rpm as R.sh)
Created attachment 337115 [details] Patch for /etc/profile.d/R.csh (found in R-2.8.1-7.fc10.src.rpm as R.csh)
Wow, that's a nasty bug. Thanks for the quick fixes. The patches for the R.sh and R.csh are obviously correct, but I think with them in place, the patch to src/scripts/R.sh.in is unnecessary. I'm going to go ahead and kick off a new set of builds with the fixed profile scripts.
Thanks for the quick response! I agree that for the shell problem the patches for /etc/profile.d/R.{sh,csh} are enough. But writing warning messages to standard output instead to standard error may break other scripts that start R - like it was the case with the one in /etc/profile.d. So I think R.sh.in should be checked for other missing redirects to standard error - in a quick skim over R.sh.in I found that the usage message an some debug messages at the end of the file should also be redirected to standard errer. This are not included in my patch - so this may be done in another update - or better done in the upstream code.
If you do work up a patch like this, I'd want it to go to upstream for review first. :)
R-2.8.1-8.fc9 has been submitted as an update for Fedora 9. http://admin.fedoraproject.org/updates/R-2.8.1-8.fc9
R-2.8.1-8.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/R-2.8.1-8.fc10
R-2.8.1-8.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
R-2.8.1-8.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.