Skip to content

Commit

Permalink
git_remote_helpers: force rebuild if python version changes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Keeping authored and Junio C Hamano committed Jan 25, 2013
1 parent 29cf0d3 commit fadf8c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions git_remote_helpers/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/GIT-PYTHON-VERSION
/build
/dist
8 changes: 7 additions & 1 deletion git_remote_helpers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fadf8c7

Please sign in to comment.