Optionally work without python

In some setups (notably server setups) you do not need that dependency.
Gracefully handle the absence of python when NO_PYTHON is defined.

Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Johannes Schindelin
2006-02-18 13:01:18 +01:00
committed by Junio C Hamano
parent 289c4b36e3
commit abb7c7b31c
7 changed files with 32 additions and 1 deletions

View File

@ -15,6 +15,10 @@ shellquote = '$(call shq,$(1))'
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
ifdef NO_PYTHON
GIT_TEST_OPTS += --no-python
endif
all: $(T) clean
$(T):

View File

@ -42,7 +42,7 @@ fi
. ./test-lib.sh
"$PYTHON" -c 'import subprocess' || {
test "$no_python" || "$PYTHON" -c 'import subprocess' || {
echo >&2 'Your python seem to lack "subprocess" module.
Please check INSTALL document.'
exit 1

View File

@ -10,6 +10,12 @@
test_description='Test criss-cross merge'
. ./test-lib.sh
if test "$no_python"; then
echo "Skipping: no python => no recursive merge"
test_done
exit 0
fi
test_expect_success 'prepare repository' \
'echo "1
2

View File

@ -3,6 +3,12 @@
test_description='Merge-recursive merging renames'
. ./test-lib.sh
if test "$no_python"; then
echo "Skipping: no python => no recursive merge"
test_done
exit 0
fi
test_expect_success setup \
'
cat >A <<\EOF &&

View File

@ -63,6 +63,8 @@ do
exit 0 ;;
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
verbose=t; shift ;;
--no-python)
no_python=t; shift ;;
*)
break ;;
esac