[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


https://bugs.libre-soc.org/show_bug.cgi?id=714

--- 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):
['/usr/bin/bash\n']
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