#!/bin/sh
#
# setpython - create a local link from 'python' to a specified version
#
# This script is used to to redirect the 'python' in reposurgeon's
# shebang line to a specified version when running regression tests.

if [ -z "$1" ]
then
	ls -l python
elif [ $1 = "python" ]
then
	rm -f ./python
elif [ $1 = python2 -o $1 = python3 ]
then
	set -- `whereis $1`
	shift
	case $1 in
		*/bin/*) ln -sf $1 ./python; echo "python -> $1";;
		*) echo "setpython: no python binary" >&2;;
	esac
else
	echo "setpython: unrecognized python version" >&2
fi
