changeset 1661:9590332b26c8

debian: don't refer to deleted tests/run-tests.py in debian/rules tests/run-tests.py was deleted in 25a0c31882df (tests: remove the custom run-tests.py, 2015-11-02), but we still refer to it in debian/rules. Fix by having the user define a HGSRC variable when calling 'debuild' (with e.g '-e HGSRC=~/hg').
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 14 Dec 2015 16:29:55 -0800
parents 42c30774e63d
children 25254b2f8116
files debian/rules
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/debian/rules
+++ b/debian/rules
@@ -8,9 +8,13 @@
 	dh_auto_build
 	$(MAKE) -C docs
 
+hgsrc_defined:
+	# Use "! -z" instead of "-n", because "-n" without arguments is true
+	test ! -z $(HGSRC) && test -d $(HGSRC) || (echo "$(HGSRC) is not a directory"; false)
+
 ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
-override_dh_auto_test:
-	cd tests &&  python run-tests.py --with-hg=`which hg` --blacklist=$(CURDIR)/debian/test-blacklist
+override_dh_auto_test: hgsrc_defined
+	cd tests && python $(HGSRC)/tests/run-tests.py --with-hg=$(HGSRC)/hg --blacklist=$(CURDIR)/debian/test-blacklist
 endif
 
 override_dh_python2: