/usr/share/doc/yade/scripts/yade-exec-wrapper is in yade 1.20.0-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/usr/bin/python
"""Get yade binary as the first argument. Run it, passing all other arguments.
If yade succeeds or crashes at exit, return success, otherwise return the same error as yade.
Purpose: run binary even if no installed in the PREFIX (using YADE_PREFIX),
and return no error if there is only (expected) crash at exit.
You should only run non-interactive sessions this way.
"""
import os,sys,subprocess
from os.path import *
bin=abspath(sys.argv[1])
print bin,dirname(bin)
prefix=normpath(dirname(bin)+'/..')
cmd='DISPLAY= LD_PRELOAD= YADE_PREFIX='+prefix+' '+' '.join(sys.argv[1:])
print cmd
p=subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,shell=True)
pout=p.communicate()[0]
retval=p.wait()
print pout
if retval==0 or 'Yade: normal exit.' in pout: sys.exit(0)
sys.exit(retval)
|