[Pyobjc-dev] bootstrapping with execve in /bin/sh?
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2002-11-26 13:29:49
|
Ok, ok, I take it all back about requiring Jaguar just so we can use /usr/bin/python for bootstrapping... This was Ronald's suggestion from a while back: > sh? > > #!/bin/bash > > res=$(dirname $(dirname ${0}))/Resources > main=${res}/main.py > export PYTHONPATH > PYTHONPATH=$res > > exec /usr/local/bin/python ${main} > # end of file I've actually managed to make it sortof work (hey, I've never written a shell script before! ;-). But I'm running into a problem: the runtime can't find the path for the main nib: Traceback (most recent call last): File "/Users/just/code/pyobjc/Examples/TableModel/build/TableModel.app/Contents/ Resources/TableModel.py", line 19, in ? NibClassBuilder.extractClasses("MainMenu") File "/usr/lib/python2.2/site-packages/AppKit/NibClassBuilder.py", line 128, in extractClasses self._extractClassesFromNibFromBundle(nibName, bundle) File "/usr/lib/python2.2/site-packages/AppKit/NibClassBuilder.py", line 144, in _extractClassesFromNibFromBundle raise NibLoaderError, ("Could not find nib named '%s' " AppKit.NibClassBuilder.NibLoaderError: Could not find nib named 'MainMenu' in bundle 'NSBundle </usr/bin> (I assume that if NibClassLoader.py wasn't used here, it would exit with a similar message from NSApplicationMain().) I'm not sure, but I _think_ it's because 'exec' in /bin/sh isn't exactly the same as execve(). Does this sound plausible? If so, what _is_ the equivalent of execve() in sh? Also: the exporting of PYTHONPATH doesn't work as written above: os.environ doesn't show it. Any clues? (googling for "execve" and "sh" only gives me hits for execve("/bin/sh", ...); ;-) Just |