[diffoscope] 01/02: debian/rules: always run the version check, not only during full build

Mattia Rizzolo mattia at debian.org
Fri Jun 3 17:34:11 CEST 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository diffoscope.

commit 1d70476a89b4f4bb02bd0e31737f43fd0ea1b91f
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Fri Jun 3 14:45:50 2016 +0000

    debian/rules: always run the version check, not only during full build
    
    This rewrites the check in pure make, so also avoids spawing a shell and makes
    the error message more visible.
    And get rid of override_dh_build too.
---
 debian/rules | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/debian/rules b/debian/rules
index f7570f5..b15a73b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,17 +1,15 @@
 #!/usr/bin/make -f
 
-VERSION = $(shell dpkg-parsechangelog --show-field Version)
+VERSION_dch := $(shell dpkg-parsechangelog --show-field Version)
+VERSION_py := $(shell awk '/^VERSION = / {gsub(/"/, "", $$3); print $$3}' diffoscope/__init__.py )
+
+ifneq ($(VERSION_dch),$(VERSION_py))
+ $(error "Version in debian/changelog doesn't match diffoscope version")
+endif
 
 %:
 	dh $@ --with python3 --buildsystem=pybuild
 
-override_dh_auto_build:
-	@if ! grep -q 'VERSION = "$(VERSION)"' diffoscope/__init__.py; then \
-		echo "Version in debian/changelog doesn't match diffoscope version"; \
-		exit 1; \
-	fi
-	dh_auto_build -O--buildsystem=pybuild
-
 override_dh_python3:
 	dh_python3 --recommends=python-debian --recommends=rpm-python --recommends=tlsh --recommends=guestfs
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list