[gobolinux-users] Problem with environment

Lucas C. Villa Real lucasvr at gobolinux.org
Fri Jan 15 18:33:12 NZDT 2010

===On Mon, Jan 4, 2010 at 8:07 PM, Zbigniew <lists at ispid.com.pl> wrote:
> I've detected a flaw related to environment variables setting:
> Recently I'm evaluating fish shell ( http://fishshell.org/ ) - looks very
> interesting - and I noticed, that some of applications have some problems,
> for example Firefox is now unable to find its Java-plugin (part of JRE).
> Looking around, I've discovered, that it's most probably related to
> environment variables: fish has different scripting language, with syntax
> different from that of sh/bash/zsh, and some of the environment variables
> - like for example the ones mentioned in /System/Links/Environment/Cache -
> are not set.
> From the other side: they doesn't have to be set permanently; the file
> /Programs/Firefox/Current/bin/firefox is the shell script, containing at the
> very first line "#!/bin/sh" - so it's starting sh on its own anyway. And
> because of this it seems to me, that there must be some kind of error in
> using the contents of the file /System/Links/Environment/Cache, if it
> requires, that the user has to choose bash (or other POSIX-compliant shell)
> as his login shell. There shouldn't be such requirement.

Indeed, the Cache file doesn't have a default interpreter by default.
That can be considered a bug. I'll make some changes to Scripts
tomorrow to fix that.

> And because of this my questions:
> 1. Actually, how (and when) the file /System/Links/Environment/Cache is
> used?

It's sourced by zshrc, xprofile and bashrc on login.

> 2. If I properly understand, its contents has been made out of every
> file linked from /System/Links/Environment ? But when exactly is this done?

That's basically a 'for' loop like this:
for env in /System/Links/Environment/*--*; do cat $env >>
/System/Links/Environment/Cache; done

You can verify that by looking at the bottom of /System/Settings/bashrc.

> 3. And what can be done to fix the described problem?

Ensure that "#!/bin/sh" is added to Get_Env_Cache() in
Functions/GoboLinux and remove the replicated code from
/System/Settings/{bashrc,xprofile,zshrc} (or propagate the change to
those files, too).

> Thanks in advance for any tips.


More information about the gobolinux-users mailing list