chiark / gitweb /
test: Use configured Python
authorMartin Pitt <martin.pitt@ubuntu.com>
Tue, 20 Jan 2015 11:46:28 +0000 (12:46 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Tue, 20 Jan 2015 11:49:08 +0000 (12:49 +0100)
Don't hardcode "python" or /usr/bin/python, but use the configured $(PYTHON).

Makefile.am
test/rule-syntax-check.py [changed mode: 0755->0644]
test/rules-test.sh

index 5b789d00275e7d269f290e573afd26e9d46cb7a5..788e63498c8ce09980c90f0d68e9aa84840972d1 100644 (file)
@@ -149,6 +149,7 @@ check_DATA =
 tests=
 manual_tests =
 if ENABLE_TESTS
+export PYTHON
 noinst_PROGRAMS = $(manual_tests) $(tests)
 TESTS = $(tests)
 else
old mode 100755 (executable)
new mode 100644 (file)
index 8da38cd..8c0180b
@@ -1,4 +1,3 @@
-#!/usr/bin/python
 # Simple udev rules syntax checker
 #
 # (C) 2010 Canonical Ltd.
index 47d42cb3faaa0b50ae669fa7c48e8cc08212e8d3..219575360e49a198776eb05a617b09dd19a1eb80 100755 (executable)
@@ -20,9 +20,9 @@
 [ -n "$srcdir" ] || srcdir=`dirname $0`/..
 
 # skip if we don't have python
-type python >/dev/null 2>&1 || {
-        echo "$0: No python installed, skipping udev rule syntax check"
+type ${PYTHON:-python} >/dev/null 2>&1 || {
+        echo "$0: No $PYTHON installed, skipping udev rule syntax check"
         exit 0
 }
 
-$srcdir/test/rule-syntax-check.py `find $srcdir/rules -name '*.rules'`
+$PYTHON $srcdir/test/rule-syntax-check.py `find $srcdir/rules -name '*.rules'`