diff options
author | David Garcia Quintas <dgq@google.com> | 2016-03-18 10:12:48 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-03-18 10:12:48 -0700 |
commit | 72266d3f71f71888a09bd03bed3339452ba0e3ac (patch) | |
tree | f2f9cb71f4cc5757ea11c7d3272de1f676d5b472 /tools | |
parent | 185768b7024504bdb94d3b5448c7ddffc31a5151 (diff) | |
parent | 47277bc12775fdf96648668cabcab4321a004c38 (diff) |
Merge branch 'master' of github.com:grpc/grpc into guard_check
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/distrib/python_wrapper.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tools/distrib/python_wrapper.sh b/tools/distrib/python_wrapper.sh new file mode 100755 index 0000000000..347a715c85 --- /dev/null +++ b/tools/distrib/python_wrapper.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +for p in python2.7 python2.6 python2 python not_found ; do + + python=`which $p || echo not_found` + + if [ -x "$python" ] ; then + break + fi + +done + +if [ -x "$python" ] ; then + exec $python $@ +else + echo "No acceptable version of python found on the system" + exit 1 +fi |