debian: don't refer to deleted tests/run-tests.py in debian/rules
authorMartin von Zweigbergk <martinvonz@google.com>
Mon, 14 Dec 2015 16:29:55 -0800
changeset 1565 9590332b26c8
parent 1564 42c30774e63d
child 1566 25254b2f8116
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').
debian/rules
--- a/debian/rules	Fri Dec 11 12:27:37 2015 -0800
+++ b/debian/rules	Mon Dec 14 16:29:55 2015 -0800
@@ -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: