changeset 25212:ec119a613e3b stable

build: require a clean hg state for make dist * Makefile.am (hg-id-dist-hook): Raise an error if the hg id shows that the working tree is not committed. (DIST_IGNORE_HG_STATE): Allow the user to override the condition.
author Mike Miller <mtmiller@octave.org>
date Wed, 11 Apr 2018 10:28:16 -0700
parents 078abe2f7a44
children 7f6b4483468d
files Makefile.am
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Wed Apr 11 10:05:37 2018 -0700
+++ b/Makefile.am	Wed Apr 11 10:28:16 2018 -0700
@@ -244,6 +244,13 @@
 
 if AMCOND_ENABLE_HG_ID
 hg-id-dist-hook:
+	@test x"$(DIST_IGNORE_HG_STATE)" != x \
+	  || echo $(HG_ID_VAR) | $(GREP) '^[0-9a-f]\{12\}$$' >/dev/null 2>&1 \
+	  || { echo ; \
+	       echo "Packaging distribution requires a clean hg working tree with no uncommitted changes." ; \
+	       echo "Please commit or revert your changes first, or pass DIST_IGNORE_HG_STATE=1." ; \
+	       echo "Cannot package distribution!" ; \
+	       echo ; exit 1; }
 else
 hg-id-dist-hook:
 	@echo "WARNING: Octave was configured with --disable-hg-id" 1>&2