From 7dcc15d02d997e88c075976a55bf07e789cd18fd Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Wed, 7 Jun 2017 18:13:09 -0600 Subject: makefile: fix python 2/3 detection in the Makefile Fix detection of python in a non-python3 environment. The old path always used python3. The 2 fixes here are: a.) escape the '$' before the subshell. b.) use shell builtin 'command -v' rather than 'which' in case 'which' is not available. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 09cd1479..821be4b5 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CWD=$(shell pwd) PYVER ?= $(shell for p in python3 python2; do \ - out=$(which $$p 2>&1) && echo $$p && exit; done; \ - exit 1) + out=$$(command -v $$p 2>&1) && echo $$p && exit; done; exit 1) + noseopts ?= -v YAML_FILES=$(shell find cloudinit bin tests tools -name "*.yaml" -type f ) -- cgit v1.2.3