From b1dfe9219fa4e827697c2390495ac912e3a96ac6 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 16 Jan 2022 00:58:02 -0300 Subject: aux/workflow/dist.sh: Enforce $VERSION and $DATE from Makefil stay in sync --- aux/workflow/dist.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'aux/workflow') diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh index f950e7c..48a9d57 100755 --- a/aux/workflow/dist.sh +++ b/aux/workflow/dist.sh @@ -53,6 +53,12 @@ if git show "$VVERSION" 1>/dev/null 2>/dev/null; then exit 1 fi +if [ "v$(awk '/^VERSION *=/{print $3; exit}' Makefile)" != "$VVERSION" ]; then + echo "Version '$VVERSION' mismatch with \$(VERSION) in Makefile." >&2 + echo 'Make sure to invoke this script with "make dist".' >&2 + exit 1 +fi + if ! printf '%s\n%s\n' "$(git tag)" "$VVERSION" | sort -nct. -k1 -k2 -k3; then echo 'New tag is not bigger than existing ones.' >&2 exit 1 @@ -63,6 +69,12 @@ if [ "$DATE" != "$(git log -1 --format=%cd --date=short HEAD)" ]; then exit 1 fi +if [ "$(awk '/^DATE *=/{print $3; exit}' Makefile)" != "$DATE" ]; then + echo "Date '$DATE' mismatch with \$(DATE) in Makefile." >&2 + echo 'Make sure to invoke this script with "make dist".' >&2 + exit 1 +fi + if [ "Release $VVERSION" != "$(git log --format=%B -1 HEAD | head -n1)" ]; then echo "Commit message isn't 'Release $VVERSION'." >&2 exit 1 -- cgit v1.2.3