aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2011-11-21 17:55:20 +0200
committerGravatar David Bremner <bremner@debian.org>2011-11-24 08:41:22 -0400
commit12197e89ad20a5e3a4d9b1de8394e9727fb46946 (patch)
tree0a40744ff0a6d5fbaae81c305cbb5c157bee46d1
parent9cfafc070a4df4935781a274f039dc63790ed0c2 (diff)
make release: verify-version-*: change comparison logic
verfy-version-debian, verify-version-python and verify-version-components checked noneqality of the comparison strings and if got "positive" answer then made that goal fail. But in case of the test ([ ]) execution failed it never got to the 'then' part of the line (and the 'if [ ... ] then ... fi ' construct doesn't make the script line fail in case of problems inside [ ]. This commit inverses the "logic", so that only if the comparison for equality succeeds the script line will exit with 0 and execution can continue past the failure case to the next line (executed by another shell) with '@echo done'
-rw-r--r--Makefile.local15
1 files changed, 6 insertions, 9 deletions
diff --git a/Makefile.local b/Makefile.local
index 775f3935..b6e216a2 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -207,28 +207,25 @@ endif
.PHONY: verify-version-debian
verify-version-debian: verify-version-components
@echo -n "Checking that Debian package version is $(VERSION)-1..."
- @if [ "$(VERSION)-1" != $$(dpkg-parsechangelog | grep ^Version | awk '{print $$2}') ] ; then \
+ @[ "$(VERSION)-1" = $$(dpkg-parsechangelog | grep ^Version | awk '{print $$2}') ] || \
(echo "No." && \
- echo "Please edit version and debian/changelog to have consistent versions." && false) \
- fi
+ echo "Please edit version and debian/changelog to have consistent versions." && false)
@echo "Good."
.PHONY: verify-version-python
verify-version-python: verify-version-components
@echo -n "Checking that python bindings version is $(VERSION)..."
- @if [ "$(VERSION)" != $$(python -c "execfile('$(PV_FILE)'); print __VERSION__") ] ; then \
+ @[ "$(VERSION)" = $$(python -c "execfile('$(PV_FILE)'); print __VERSION__") ] || \
(echo "No." && \
- echo "Please edit version and $(PV_FILE) to have consistent versions." && false) \
- fi
+ echo "Please edit version and $(PV_FILE) to have consistent versions." && false)
@echo "Good."
.PHONY: verify-version-components
verify-version-components:
@echo -n "Checking that $(VERSION) consists only of digits and periods..."
- @if echo $(VERSION) | grep -q -v -x '[0-9.]*'; then \
+ @echo $(VERSION) | grep -q -x '^[0-9.]*$$' || \
(echo "No." && \
- echo "Please follow the instructions in RELEASING to choose a version" && false) \
- else :; fi
+ echo "Please follow the instructions in RELEASING to choose a version" && false)
@echo "Good."
.PHONY: verify-newer