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 <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
John Keeping committed
Jan 20, 2013 at 13:15 UTC
fadf8c71510e3ff142afd1ecbc65703d7ff27c8b
2 files changed
+8
-1
git_remote_helpers/.gitignore
+1
@@ -1,2 +1,3 @@
1
+/GIT-PYTHON-VERSION
2
/build
3
/dist
git_remote_helpers/Makefile
+7
-1
@@ -25,8 +25,14 @@ PYLIBDIR=$(shell $(PYTHON_PATH) -c \
25
"import sys; \
26
print('lib/python%i.%i/site-packages' % sys.version_info[:2])")
27
28
+py_version=$(shell $(PYTHON_PATH) -c \
29
+ 'import sys; print("%i.%i" % sys.version_info[:2])')
30
+
31
all: $(pysetupfile)
29
- $(QUIET)$(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build
32
+ $(QUIET)test "$$(cat GIT-PYTHON-VERSION 2>/dev/null)" = "$(py_version)" || \
33
+ flags=--force; \
34
+ $(PYTHON_PATH) $(pysetupfile) $(QUIETSETUP) build $$flags
35
+ $(QUIET)echo "$(py_version)" >GIT-PYTHON-VERSION
36
37
install: $(pysetupfile)
38
$(PYTHON_PATH) $(pysetupfile) install --prefix $(DESTDIR_SQ)$(prefix)