File: python_interpreter_template.in.shell

package info (click to toggle)
zope2.13 2.13.22-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 38,644 kB
  • ctags: 38,805
  • sloc: python: 196,395; xml: 90,515; ansic: 24,121; sh: 916; makefile: 333; perl: 37
file content (20 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# WARNING: this is an ugly hack which was introduced in order to workaround
#          shebang recursion issues with linux kernel << 2.6.32. It doesn't
#          work as expected. Python addsitedir() needs to be implemented in
#          shell in order to make it work.

ZPYPATH="$(echo $(for dir in /usr/lib/zope@ZVER@/lib/python/*.egg; do echo $dir; done) | sed 's/ /:/g')"

if [ -n "$PYTHONPATH" ]; then
	export PYTHONPATH="$PYTHONPATH:$ZPYPATH"
else
	export PYTHONPATH="$ZPYPATH"
fi

if [ -n "$INSTANCE_HOME" ]; then
	export PYTHONPATH="$PYTHONPATH:${INSTANCE_HOME}/lib/python"
fi

/usr/bin/python@PYVER@ "$@"