summaryrefslogtreecommitdiff
path: root/git_remote_helpers
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-01-20 13:15:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-25 03:32:29 (GMT)
commitfadf8c71510e3ff142afd1ecbc65703d7ff27c8b (patch)
treede7581b1b5426492f14bc4a1ce615c81ee67940f /git_remote_helpers
parent29cf0d3873d78f8b94353b37d9d3e32e51766a90 (diff)
downloadgit-fadf8c71510e3ff142afd1ecbc65703d7ff27c8b.zip
git-fadf8c71510e3ff142afd1ecbc65703d7ff27c8b.tar.gz
git-fadf8c71510e3ff142afd1ecbc65703d7ff27c8b.tar.bz2
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>
Diffstat (limited to 'git_remote_helpers')
-rw-r--r--git_remote_helpers/.gitignore1
-rw-r--r--git_remote_helpers/Makefile8
2 files changed, 8 insertions, 1 deletions
diff --git a/git_remote_helpers/.gitignore b/git_remote_helpers/.gitignore
index 2247d5f..cf040af 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 f65f064..0d2ae74 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)