summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-09-09 21:46:49 -0400
committerScott Moser <smoser@brickies.net>2016-09-09 21:46:49 -0400
commitea732e69516983b1d9838b0d80540a832594748a (patch)
treef23cbf03e360f913e98e15d232bcf871770806e8 /Makefile
parenteb5860ec6ed76a90fb837001ab2ed54e1dcf78de (diff)
parent34a26f7f59f2963691e36ca0476bec9fc9ccef63 (diff)
downloadvyos-cloud-init-ea732e69516983b1d9838b0d80540a832594748a.tar.gz
vyos-cloud-init-ea732e69516983b1d9838b0d80540a832594748a.zip
Merge branch 'master' into ubuntu/xenial
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 11 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 32c50aee..5d35dcc0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,20 @@
CWD=$(shell pwd)
-PYVER ?= 3
+PYVER ?= $(shell for p in python3 python2; do \
+ out=$(which $$p 2>&1) && echo $$p && exit; done; \
+ exit 1)
noseopts ?= -v
YAML_FILES=$(shell find cloudinit bin tests tools -name "*.yaml" -type f )
YAML_FILES+=$(shell find doc/examples -name "cloud-config*.txt" -type f )
-CHANGELOG_VERSION=$(shell $(CWD)/tools/read-version)
-CODE_VERSION=$(shell python -c "from cloudinit import version; print version.version_string()")
-
PIP_INSTALL := pip install
-ifeq ($(PYVER),3)
+ifeq ($(PYVER),python3)
pyflakes = pyflakes3
unittests = unittest3
yaml = yaml
else
-ifeq ($(PYVER),2)
+ifeq ($(PYVER),python2)
pyflakes = pyflakes
unittests = unittest
else
@@ -28,6 +27,10 @@ ifeq ($(distro),)
distro = redhat
endif
+READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version)
+CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.version_string())")
+
+
all: check
check: check_version pep8 $(pyflakes) test $(yaml)
@@ -58,8 +61,8 @@ pip-test-requirements:
test: $(unittests)
check_version:
- @if [ "$(CHANGELOG_VERSION)" != "$(CODE_VERSION)" ]; then \
- echo "Error: ChangeLog version $(CHANGELOG_VERSION)" \
+ @if [ "$(READ_VERSION)" != "$(CODE_VERSION)" ]; then \
+ echo "Error: read-version version $(READ_VERSION)" \
"not equal to code version $(CODE_VERSION)"; exit 2; \
else true; fi