Here's an example (which the next update for app-shells/scsh exhibits): In /etc/env.d/50scsh: SCSH_LIB_DIRS='"/usr/lib/scsh/modules/0.6" "/usr/lib/scsh" "."' In /etc/profile.env after env-update has run: export SCSH_LIB_DIRS=''/usr/lib/scsh/modules/0.6 /usr/lib/scsh .'' Which of course fails with: -bash: export: `/usr/lib/scsh': not a valid identifier -bash: export: `.': not a valid identifier Needs to be fixed. The workaround is to "einfo" something like "Sorry, env-update doesn't handle a corner case. Please manually add export SCSH_LIB_DIRS=''/usr/lib/scsh/modules/0.6 /usr/lib/scsh .'' to your /etc/profile"... which is unprofessional of course.
It might not be clear depending on what font you're using but the '' in export SCSH_LIB_DIRS=''/usr/lib/scsh/modules/0.6 /usr/lib/scsh .'' Is two (2) single quotes, NOT a double quote.
portage manages env-update
I'm going to guess this is csh? This definately doesn't play well with bash. Could you provide a rough outline of the meaning and how it is supposed to result?
Its not csh, its not even shell dependent. The environment variable should *contain* several strings in double quotes, separated by white space. ie. if you echo $SCSH_LIB_DIRS, then the following is the expected output: $ echo $SCSH_LIB_DIRS "/usr/lib/scsh/modules/0.6" "/usr/lib/scsh" "." $ The fact that these are paths in double quotes separated by space should not be interpretted by the bash. (If you really want to know the reason, then app-shells/scsh scsh binary looks in that environment variable and calls the scheme reader function (which reads scheme expressions -- like "asdf" and '(a b c) are scheme expressions) in a loop until all scheme expressions have been read. Presumably this builds up a list of paths for it to search for libraries in.)
I guess their algorithm for operating on the environment variable looks something like this: (defun read-paths (stream) (let ((path (read stream))) (when path (cons path (read-paths stream))))) (with-input-from-string (stream (get-env "SCSH_LIB_DIRS")) (read-paths stream)) => ("/usr/lib/scsh/modules/0.6" "/usr/lib/scsh" ".") ...excuse my broken scheme accent.
Bug 58564 and bug 58565 on this. I could incorporate the ebuild and eclass as is (ie. "please add some foo to your /etc/profile now because /etc/env.d is broken") but it really requires the /etc/env.d system to be a policy compliant port.
Created attachment 58848 [details, diff] remove extra variable expansion the problem with the quoting is that the text is parsed twice: once by getconfig() and once by varexpand(). i removed the varexpand(), which seems to solve this problem. also, i was working on a file to provide MAIL=$HOME/.maildir which required \\\$HOME to get the $ through. the first pass turned \\ -> \ and \$ -> $ resulting in '\$HOME' which was then reparsed into $HOME. without the removal of varexpand there appeared no way to sneak a ' (so that $HOME could be evaluated by the shell on login) past env-update.
Yep. That makes a total of three varexpand calls per special - there's one in getconfig too.
Fixed on or before 2.0.51.22-r1
Looking through the batch of bugs, I'm not sure that some of these are actually fixed in stable. Others, the requirements have possibly changed after the initial fix was committed. If you think this bug has been closed incorrectly, please reopen or ask that it be reopened.