[PATCH] make release: verify-version-*: change comparison logic
authorTomi Ollila <tomi.ollila@iki.fi>
Mon, 21 Nov 2011 15:55:20 +0000 (17:55 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:20 +0000 (09:40 -0800)
bc/c268c3fc04455ddfe3700a18d5860f515eb6d9 [new file with mode: 0644]

diff --git a/bc/c268c3fc04455ddfe3700a18d5860f515eb6d9 b/bc/c268c3fc04455ddfe3700a18d5860f515eb6d9
new file mode 100644 (file)
index 0000000..619bfef
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <tomi.ollila@nixu.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id F065D429E21\r
+       for <notmuch@notmuchmail.org>; Mon, 21 Nov 2011 07:55:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id y6-xAz8TuIud for <notmuch@notmuchmail.org>;\r
+       Mon, 21 Nov 2011 07:55:22 -0800 (PST)\r
+Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 44EB4431FD0\r
+       for <notmuch@notmuchmail.org>; Mon, 21 Nov 2011 07:55:22 -0800 (PST)\r
+Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
+       by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id\r
+       pALFtKUi001161\r
+       for <notmuch@notmuchmail.org>; Mon, 21 Nov 2011 17:55:20 +0200\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: <notmuch@notmuchmail.org>\r
+Subject: [PATCH] make release: verify-version-*: change comparison logic\r
+User-Agent: Notmuch/0.10~rc1+16~gc832dad (http://notmuchmail.org) Emacs/23.3.1\r
+       (i686-pc-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 21 Nov 2011 17:55:20 +0200\r
+Message-ID: <yf6bos58o7r.fsf@taco2.nixu.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 21 Nov 2011 15:55:23 -0000\r
+\r
+verfy-version-debian, verify-version-python and verify-version-components\r
+checked noneqality of the comparison strings and if got "positive"\r
+answer then made that goal fail. But in case of the test ([ ])\r
+execution failed it never got to the 'then' part of the line (and\r
+the 'if [ ... ] then ... fi ' construct doesn't make the script line\r
+fail in case of problems inside [ ].\r
+This commit inverses the "logic", so that only if the comparison for\r
+equality succeeds the script line will exit with 0 and execution\r
+can continue past the failure case to the next line (executed by another\r
+shell) with '@echo done'\r
+---\r
+ Makefile.local |   15 ++++++---------\r
+ 1 files changed, 6 insertions(+), 9 deletions(-)\r
+\r
+diff --git a/Makefile.local b/Makefile.local\r
+index 775f393..b6e216a 100644\r
+--- a/Makefile.local\r
++++ b/Makefile.local\r
+@@ -207,28 +207,25 @@ endif\r
+ .PHONY: verify-version-debian\r
+ verify-version-debian: verify-version-components\r
+       @echo -n "Checking that Debian package version is $(VERSION)-1..."\r
+-      @if [ "$(VERSION)-1" != $$(dpkg-parsechangelog | grep ^Version | awk '{print $$2}') ] ; then \\r
++      @[ "$(VERSION)-1" = $$(dpkg-parsechangelog | grep ^Version | awk '{print $$2}') ] || \\r
+               (echo "No." && \\r
+-               echo "Please edit version and debian/changelog to have consistent versions." && false) \\r
+-       fi\r
++               echo "Please edit version and debian/changelog to have consistent versions." && false)\r
+       @echo "Good."\r
\r
+ .PHONY: verify-version-python\r
+ verify-version-python: verify-version-components\r
+       @echo -n "Checking that python bindings version is $(VERSION)..."\r
+-      @if [ "$(VERSION)" != $$(python -c "execfile('$(PV_FILE)'); print __VERSION__") ] ; then \\r
++      @[ "$(VERSION)" = $$(python -c "execfile('$(PV_FILE)'); print __VERSION__") ] || \\r
+               (echo "No." && \\r
+-               echo "Please edit version and $(PV_FILE) to have consistent versions." && false) \\r
+-       fi\r
++               echo "Please edit version and $(PV_FILE) to have consistent versions." && false)\r
+       @echo "Good."\r
\r
+ .PHONY: verify-version-components\r
+ verify-version-components:\r
+       @echo -n "Checking that $(VERSION) consists only of digits and periods..."\r
+-      @if echo $(VERSION) | grep -q -v -x '[0-9.]*'; then \\r
++      @echo $(VERSION) | grep -q -x '^[0-9.]*$$' || \\r
+               (echo "No." && \\r
+-               echo "Please follow the instructions in RELEASING to choose a version" && false) \\r
+-       else :; fi\r
++               echo "Please follow the instructions in RELEASING to choose a version" && false)\r
+       @echo "Good."\r
\r
+ .PHONY: verify-newer\r
+-- \r
+1.7.7.3\r
+\r