Make rpcgen_wrapper.sh work on systems without a "python2" binary

This commit is contained in:
Nick Mathewson 2012-11-16 10:28:19 -05:00
parent ac009f9245
commit f3009e48c7

View File

@ -26,9 +26,17 @@ exit_failed() {
exit 1
}
if [ -x /usr/bin/python2 ] ; then
PYTHON2=/usr/bin/python2
elif [ "x`which python2`" != x ] ; then
PYTHON2=python2
else
PYTHON2=python
fi
srcdir=$1
srcdir=${srcdir:-.}
${srcdir}/../event_rpcgen.py ${srcdir}/regress.rpc
${PYTHON2} ${srcdir}/../event_rpcgen.py ${srcdir}/regress.rpc
case "$?" in
0)
exit_updated