aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-runner/bin/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-runner/bin/Makefile.am')
-rw-r--r--tests/test-runner/bin/Makefile.am11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test-runner/bin/Makefile.am b/tests/test-runner/bin/Makefile.am
index e843e4e09..30c564e55 100644
--- a/tests/test-runner/bin/Makefile.am
+++ b/tests/test-runner/bin/Makefile.am
@@ -2,3 +2,14 @@ pkgdatadir = $(datadir)/@PACKAGE@/test-runner/bin
dist_pkgdata_SCRIPTS = \
test-runner.py \
zts-report.py
+#
+# These scripts are compatibile with both Python 2.6 and 3.4. As such the
+# python 3 shebang can be replaced at install time when targeting a python
+# 2 system. This allows us to maintain a single version of the source.
+#
+if USING_PYTHON_2
+install-data-hook:
+ sed --in-place 's|^#!/usr/bin/python3|#!/usr/bin/python2|' \
+ $(DESTDIR)$(pkgdatadir)/test-runner.py \
+ $(DESTDIR)$(pkgdatadir)/zts-report.py
+endif