[Libre-soc-bugs] [Bug 714] Coriolis2 Installation as Normal User Script

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Oct 1 20:47:30 BST 2021


--- Comment #1 from andrey at technepisteme.xyz ---
Noticed the reason why "coriolisEnv.py" fails when executed from shell script.

The python script calls the unix utility "which" with an argument of the shell.
The command looks like this:
whichCommand  = subprocess.Popen ( ['which', shell ], stdout=subprocess.PIPE )

Where "shell" is determined by:
shell         = psCommand.stdout.readlines()[1][:-1].split()[3].lstrip('-')

When ran manually, "shell" returned is:
Shell: bash
which is what we want.

When ran inside a shell script, the name of the script is returned instead! At
the moment I'm using a test script called "test-coriolisenv" and the value
returned is the first 15 chars of the script name:
Shell: test-coriolisen

The method stdout.readline() of "whichCommand" is correct when ran manually
(the path to bash):
And empty when inside the script (because there's no programme called
"test-coriolisen" hahaha!)

I'm happy at least that I identified the issue, now I need to think how to fix
it. Certainly renaming "coriolis-install" to "bash" wouldn't be very prudent.
I'll look further into it tomorrow.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list