--- /dev/null
+Return-Path: <too@guru-group.fi>\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 AD85C431FD8\r
+ for <notmuch@notmuchmail.org>; Fri, 8 Nov 2013 09:31:11 -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 cn9-qdbcTzsX for <notmuch@notmuchmail.org>;\r
+ Fri, 8 Nov 2013 09:31:05 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 0F68A431FC9\r
+ for <notmuch@notmuchmail.org>; Fri, 8 Nov 2013 09:31:05 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 03BB41000E0; Fri, 8 Nov 2013 19:30:59 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] devel/release-checks.sh: check\r
+ NOTMUCH_(MAJOR|MINOR|MICRO)_VERSION\r
+Date: Fri, 8 Nov 2013 19:30:56 +0200\r
+Message-Id: <1383931856-5377-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+Cc: tomi.ollila@iki.fi\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: Fri, 08 Nov 2013 17:31:11 -0000\r
+\r
+New defines NOTMUCH_MAJOR_VERSION, NOTMUCH_MINOR_VERSION and\r
+NOTMUCH_MICRO_VERSION were added to lib/notmuch.h.\r
+Check that these match the current value defined in ./version.\r
+---\r
+ devel/release-checks.sh | 36 ++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 36 insertions(+)\r
+\r
+diff --git a/devel/release-checks.sh b/devel/release-checks.sh\r
+index 4eff1a7..d6410ad 100755\r
+--- a/devel/release-checks.sh\r
++++ b/devel/release-checks.sh\r
+@@ -13,6 +13,8 @@ fi\r
+ set -o posix\r
+ set -o pipefail # bash feature\r
+ \r
++readonly DEFAULT_IFS="$IFS" # Note: In this particular case quotes are needed.\r
++\r
+ # Avoid locale-specific differences in output of executed commands\r
+ LANG=C LC_ALL=C; export LANG LC_ALL\r
+ \r
+@@ -20,8 +22,10 @@ readonly PV_FILE='bindings/python/notmuch/version.py'\r
+ \r
+ # Using array here turned out to be unnecessarily complicated\r
+ emsgs=''\r
++emsg_count=0\r
+ append_emsg ()\r
+ {\r
++ emsg_count=$((emsg_count + 1))\r
+ emsgs="${emsgs:+$emsgs\n} $1"\r
+ }\r
+ \r
+@@ -73,6 +77,38 @@ case $VERSION in\r
+ *) verfail "'$VERSION' is a single number" ;;\r
+ esac\r
+ \r
++_set_version_components ()\r
++{\r
++ VERSION_MAJOR=$1\r
++ VERSION_MINOR=$2\r
++ VERSION_MICRO=${3:-0} # set to 0 in case $3 is unset or "null" (string)\r
++}\r
++\r
++IFS=.\r
++_set_version_components $VERSION\r
++IFS=$DEFAULT_IFS\r
++\r
++echo -n "Checking that libnotmuch version macros match $VERSION... "\r
++NOTMUCH_MAJOR_VERSION=broken\r
++NOTMUCH_MINOR_VERSION=broken\r
++NOTMUCH_MICRO_VERSION=broken\r
++eval `awk 'NF == 3 && $1 == "#define" && $2 ~ /^NOTMUCH_[A-Z]+_VERSION$/ \\r
++ && $3 ~ /^[0-9]+$/ { print $2 "=" $3 }' lib/notmuch.h`\r
++\r
++check_version_component ()\r
++{\r
++ eval local v1=\$VERSION_$1\r
++ eval local v2=\$NOTMUCH_$1_VERSION\r
++ if [ $v1 != $v2 ]\r
++ then append_emsg "NOTMUCH_$1_VERSION is defined as '$v2' in lib/notmuch.h instead of '$v1'"\r
++ fi\r
++}\r
++\r
++old_emsg_count=$emsg_count\r
++check_version_component MAJOR\r
++check_version_component MINOR\r
++check_version_component MICRO\r
++[ $old_emsg_count = $emsg_count ] && echo Yes. || echo No.\r
+ \r
+ echo -n "Checking that this is Debian package for notmuch... "\r
+ read deb_notmuch deb_version rest < debian/changelog\r
+-- \r
+1.8.0\r
+\r