From: John Keeping Date: Sun, 20 Jan 2013 13:15:33 +0000 (+0000) Subject: git_remote_helpers: force rebuild if python version changes X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fadf8c7;p=git.git git_remote_helpers: force rebuild if python version changes When different version of python are used to build via distutils, the behaviour can change. Detect changes in version and pass --force in this case. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- diff --git a/git_remote_helpers/.gitignore b/git_remote_helpers/.gitignore index 2247d5f95..cf040af3f 100644 --- a/git_remote_helpers/.gitignore +++ b/git_remote_helpers/.gitignore @@ -1,2 +1,3 @@ +/GIT-PYTHON-VERSION /build /dist diff --git a/git_remote_helpers/Makefile b/git_remote_helpers/Makefile index f65f0645e..0d2ae740b 100644 --- a/git_remote_helpers/Makefile +++ b/git_remote_helpers/Makefile @@ -25,8 +25,14 @@ PYLIBDIR=$(shell $(PYTHON_PATH) -c \ "import sys; \ print('lib/python%i.%i/site-packages' % sys.version_info[:2])") +py_version=$(shell $(PYTHON_PATH) -c \ + 'import sys; print("%i.%i" % sys.version_info[:2])') + all: $(pysetupfile) - $(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build + $(QUIET)test "$$(cat GIT-PYTHON-VERSION 2>/dev/null)" = "$(py_version)" || \ + flags=--force; \ + $(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build $$flags + $(QUIET)echo "$(py_version)" >GIT-PYTHON-VERSION install: $(pysetupfile) $(PYTHON_PATH) $(pysetupfile) install --prefix $(DESTDIR_SQ)$(prefix)