diff options
author | Scott Moser <smoser@brickies.net> | 2016-08-05 15:51:34 -0400 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2016-08-05 16:53:53 -0400 |
commit | 42bed116b411eb25ebd8368b2b4ed6c56ffd85e7 (patch) | |
tree | 60af1c21adda46878ccf9a0c6ab1b3640fa61a4a /Makefile | |
parent | 10f82bd474c5bc91b330beccd883da06b0014a99 (diff) | |
download | vyos-cloud-init-42bed116b411eb25ebd8368b2b4ed6c56ffd85e7.tar.gz vyos-cloud-init-42bed116b411eb25ebd8368b2b4ed6c56ffd85e7.zip |
drop modification of version during make-tarball, tools changes.
Modification of the tarball became problematic, as it meant that
any tool extracting source would find the orig source tarball different.
I found this unusable when trying to use 'gbp buildpackage'.
Other changes here are to better support using python3 or python2
for the build. Makefile will try to call the right python version
and can be told which python to use.
read-version: by adding 'tiny_p' and avoiding the import of
cloudinit.util, we need less dependencies to run this.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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 |