Try a more portable call of "ps" in coriolisEnv.py.
This commit is contained in:
parent
9cfa104836
commit
91e7685921
|
@ -158,14 +158,15 @@ def guessShell ( forcedShell ):
|
||||||
]
|
]
|
||||||
if shellName is None:
|
if shellName is None:
|
||||||
try:
|
try:
|
||||||
psResult = subprocess.run( ['ps', '-p', str(os.getppid()) ], capture_output=True, check=True )
|
psResult = subprocess.run( ['ps', '-o', 'comm', '-p', str(os.getppid()) ]
|
||||||
shell = psResult.stdout.splitlines()[1].decode('utf8').split()[3].lstrip('-')
|
, capture_output=True, check=True )
|
||||||
|
shell = psResult.stdout.splitlines()[1].decode('utf8').split()[0].lstrip('-')
|
||||||
whichCommand = subprocess.run( ['which', shell ], capture_output=True, check=True )
|
whichCommand = subprocess.run( ['which', shell ], capture_output=True, check=True )
|
||||||
shellPath = whichCommand.stdout.splitlines()[0].decode('utf8')
|
shellPath = whichCommand.stdout.splitlines()[0].decode('utf8')
|
||||||
except Exception:
|
except Exception:
|
||||||
shellPath = u'/bin/bash'
|
shellPath = u'/bin/bash'
|
||||||
print( 'echo "Shell *NOT* guessed, using {}";'.format(shellPath) )
|
print( 'echo "Shell *NOT* guessed, using {}";'.format(shellPath) )
|
||||||
#print( 'GUESSED shellPath={}'.format(shellPath) )
|
print( 'echo "GUESSED shellPath={}";'.format(shellPath) )
|
||||||
else:
|
else:
|
||||||
shellPath = forcedShell
|
shellPath = forcedShell
|
||||||
#print( 'FORCED shellPath={}'.format(shellPath) )
|
#print( 'FORCED shellPath={}'.format(shellPath) )
|
||||||
|
@ -301,7 +302,7 @@ if __name__ == "__main__":
|
||||||
shellMessage = "Using script location Coriolis 2 (%s)" % rootDir
|
shellMessage = "Using script location Coriolis 2 (%s)" % rootDir
|
||||||
|
|
||||||
if osType.startswith("Cygwin"):
|
if osType.startswith("Cygwin"):
|
||||||
strippedPath = "%s/lib:%s" % ( coriolisTop, libDir, strippedPath )
|
strippedPath = "%s/lib:%s" % ( coriolisTop, strippedPath )
|
||||||
if not os.path.exists(coriolisTop):
|
if not os.path.exists(coriolisTop):
|
||||||
print( 'echo "[ERROR] coriolisEnv.py, top directory "{}" do not exists."'.format( coriolisTop ))
|
print( 'echo "[ERROR] coriolisEnv.py, top directory "{}" do not exists."'.format( coriolisTop ))
|
||||||
sys.exit( 1 )
|
sys.exit( 1 )
|
||||||
|
|
Loading…
Reference in New Issue