From f29eaf8684d766c99b4b4965a7ed4ee082bfab3e Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Mon, 18 Dec 2023 13:40:52 +0200 Subject: [PATCH] Make 'make check-readme' check both rev: lines If either one of them differs from the expected value, print an error and exit. (Previously the Makefile rule would be satisfied even if only one of the two rev: lines were correct.) I'm sure I'm going to regret going all-in on this shell one-liner at some point in the future when I have to debug it. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ba77eb8..f429b0b 100755 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ releasechecklist: check-readme # also release.mk will add other checks .PHONY: check-readme check-readme: @rev_line=' rev: "'"`$(PYTHON) setup.py --version`"'"' && \ - grep -q "^$$rev_line$$" README.rst || { \ + ! grep "rev: " README.rst | grep -qv "^$$rev_line$$" || { \ echo "README.rst doesn't specify $$rev_line"; \ echo "Please run make update-readme"; exit 1; }