From 355766157fa391f36388547aa97c9f6c45326630 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 24 Nov 2010 20:50:46 +0100
Subject: [PATCH] Fix version check
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Don't ask … all I say is distcheck.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 Makefile.am             | 2 +-
 autotools/check-version | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4e7ec6947..34fd055b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -638,7 +638,7 @@ check-dirs: $(BUILT_SOURCES)
 
 check-local: check-dirs
 	$(CHECK_PYTHON_CODE) $(check_python_code)
-	$(CHECK_VERSION) $(VERSION)
+	$(CHECK_VERSION) $(VERSION) $(top_srcdir)/NEWS
 
 .PHONY: lint
 lint: ganeti $(BUILT_SOURCES)
diff --git a/autotools/check-version b/autotools/check-version
index 1a2e2b382..46d8c3e1a 100755
--- a/autotools/check-version
+++ b/autotools/check-version
@@ -24,6 +24,7 @@ set -e
 shopt -s extglob
 
 readonly version=$1
+readonly newsfile=$2
 readonly numpat='+([0-9])'
 
 case "$version" in
@@ -41,7 +42,7 @@ esac
 
 readonly newsver="Version ${version/~/}"
 
-if ! grep -q -x "$newsver" NEWS
+if ! grep -q -x "$newsver" $newsfile
 then
   echo "Unable to find heading '$newsver' in NEWS" >&2
   exit 1
-- 
GitLab