changeset 25591:a932bdccdef8

check for version info in org.octave.Octave.appdata.xml for make dist * Makefile.am (DIST_HOOKS): Add appdata-dist-hook to the list. * etc/module.mk (APPDATA_XML_FILE): New variable. (appdata_DATA): Use it. (appdata-dist-hook): New rule.
author John W. Eaton <jwe@octave.org>
date Thu, 12 Jul 2018 15:06:55 -0400
parents 02766a14c461
children 053502516f38
files Makefile.am etc/module.mk
diffstat 2 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Thu Jul 12 15:00:13 2018 -0400
+++ b/Makefile.am	Thu Jul 12 15:06:55 2018 -0400
@@ -223,6 +223,7 @@
   docs-dist-hook \
   fix-file-perms-dist-hook \
   hg-id-dist-hook \
+  appdata-dist-hook \
   icons-dist-hook \
   scripts-dist-hook
 
--- a/etc/module.mk	Thu Jul 12 15:00:13 2018 -0400
+++ b/etc/module.mk	Thu Jul 12 15:06:55 2018 -0400
@@ -38,9 +38,11 @@
 
 appdatadir = $(datadir)/metainfo
 
-appdata_DATA = \
+APPDATA_XML_FILE := \
   %reldir%/icons/org.octave.Octave.appdata.xml
 
+appdata_DATA = $(APPDATA_XML_FILE)
+
 desktopdir = $(datadir)/applications
 
 desktop_DATA = \
@@ -103,6 +105,23 @@
 	$(ICOTOOL) --create --raw  $(WINDOWS_PNG_ICONS) > $@-t && \
 	mv $@-t $@
 
+## Check that the release date and version number are in
+## $(APPDATA_XML_FILE), but only for actual releases, which means
+## we skip the test if the minor version number is 0 or the patch
+## version number is not 0.
+
+appdata-dist-hook:
+	@test x"$(DIST_IGNORE_APPDATA_VERSION)" != x || \
+	 test $(OCTAVE_MINOR_VERSION) -eq 0 || \
+	 test $(OCTAVE_PATCH_VERSION) -ne 0 || \
+	 grep "<release *date=\"$(OCTAVE_RELEASE_DATE)\" *version=\"$(OCTAVE_VERSION)\"/>" $(srcdir)/$(APPDATA_XML_FILE) > /dev/null || \
+	{ echo; \
+	  echo "Packaging distribution requires the version number in the $(APPDATA_XML_FILE)."; \
+	  echo "Please update first or pass DIST_IGNORE_APPDATA_VERSION=1."; \
+	  echo "Cannot package distribution!"; \
+	  echo; exit 1; }
+.PHONY: appdata-dist-hook
+
 install-data-local: install-icons
 
 uninstall-local: uninstall-icons