diff --git a/xml/Makefile.am b/xml/Makefile.am index 12ae9ba5a4..5423c52c20 100644 --- a/xml/Makefile.am +++ b/xml/Makefile.am @@ -1,75 +1,98 @@ # # Copyright (C) 2004 Andrew Beekhof # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # MAINTAINERCLEANFILES = Makefile.in dtddir = $(CRM_DTD_DIRECTORY) dtd_SCRIPTS = crm.dtd crm-transitional.dtd xsltdir = $(dtddir) xslt_SCRIPTS = upgrade06.xsl upgrade11.xsl RNGdir = $(dtddir) # See Readme.md for details on updating schema files RNG_versions = 1.0 1.2 next RNG_generated = pacemaker.rng $(foreach base,$(RNG_versions),pacemaker-$(base).rng) RNG_cfg_base = options nodes resources constraints fencing acls RNG_base = cib $(RNG_cfg_base) status versions score rule nvset RNG_files = $(foreach base,$(RNG_base),$(wildcard $(base)*.rng)) RNG_SCRIPTS = $(RNG_files) $(RNG_generated) EXTRA_DIST = best-match.sh best_match = $(shell $(top_srcdir)/xml/best-match.sh $(1) $(2)) +versions.rng: Makefile.am + echo "" > $@ + echo "" >> $@ + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo " none" >> $@ + echo " pacemaker-0.6" >> $@ + echo " transitional-0.6" >> $@ + echo " pacemaker-0.7" >> $@ + echo " pacemaker-1.1" >> $@ + for rng in $(RNG_versions); do echo " pacemaker-$$rng" >> $@; done + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo " " >> $@ + echo "" >> $@ + echo "Built $@" + pacemaker.rng: pacemaker-$(CRM_DTD_VERSION).rng cp $(top_builddir)/xml/$< $@ -pacemaker-%.rng: +pacemaker-%.rng: $(RNG_files) best-match.sh Makefile.am echo "" > $@ echo "" >> $@ echo " " >> $@ echo " " >> $@ $(top_srcdir)/xml/best-match.sh cib $(*) $(@) " " echo " " >> $@ echo " " >> $@ for rng in $(RNG_cfg_base); do $(top_srcdir)/xml/best-match.sh $$rng $(*) $(@) " "; done echo " " >> $@ echo " " >> $@ echo " " >> $@ $(top_srcdir)/xml/best-match.sh status $(*) $(@) " " echo " " >> $@ echo " " >> $@ echo " " >> $@ echo "" >> $@ - cat $@ + echo "Built $@" rng_next = $(shell echo $(wildcard *-next.rng) | sed 's/-next.rng//g') diff: echo "Comparing changes to: $(rng_next)" for rng in $(rng_next); do echo "### $${rng}"; diff -u $${rng}-$(CRM_DTD_VERSION).rng $${rng}-next.rng; done echo "Done" sync: git rm -f $(wildcard *-next.rng) make pacemaker-next.rng clean: rm -f $(RNG_generated) diff --git a/xml/Readme.md b/xml/Readme.md index 6a968817ec..8bd13e60d1 100644 --- a/xml/Readme.md +++ b/xml/Readme.md @@ -1,36 +1,35 @@ # Updating schema files # ## Experimental features ## Experimental features go into `${base}-next.rng` Create from the most recent `${base}-${X}.${Y}.rng` if it does not already exist ## Stable features ## -The current stable version is set by `CRM_DTD_VERSION` in `configure.ac` and has the form `${X}.${Y}`. +The current stable version is set by `CRM_DTD_VERSION` in `configure.ac` and has the form `${X}.${Y}`. Bump `${X}` and set `${Y}` to `0` for syntax removals, bump `${Y}` for additions and then, -1. Update the value `configure.ac`, +1. Update the value of `CRM_DTD_VERSION` in `configure.ac`, 1. Add the new `${X}.${Y}` to `RNG_versions` in xml/Makefile.am, -1. Add the new `${X}.${Y}` to `xml/versions.rng` 1. Copy the most recent version of `${base}-*.rng` to `${base}-${X}.${Y}.rng` 1. TBA: Possibly we should be bumping CRM_FEATURE_SET too 1. Update `known_schemas` in `lib/common/xml.c`, add it prior to the entry for `pacemaker-next`. The second last field of the previous entry needs to be set to `0`. For example: /* 6 */ { 2, "pacemaker-1.2", NULL, NULL, -1, NULL }, /* - */ { 2, "pacemaker-next", NULL, NULL, -1, NULL }, /* Feature playground */ becomes: /* 6 */ { 2, "pacemaker-1.2", NULL, NULL, 0, NULL }, /* 7 */ { 2, "pacemaker-1.3", NULL, NULL, -1, NULL }, /* - */ { 2, "pacemaker-next", NULL, NULL, -1, NULL }, /* Feature playground */ ## Incompatible changes When the new syntax is not a simple addition to the previous one, an XSLT file is required that converts an old syntax to the new one. See `xml/upgrade06.xsl` for an example. \ No newline at end of file diff --git a/xml/versions.rng b/xml/versions.rng deleted file mode 100644 index cc378aff25..0000000000 --- a/xml/versions.rng +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - none - pacemaker-0.6 - transitional-0.6 - pacemaker-0.7 - pacemaker-1.0 - pacemaker-1.1 - pacemaker-1.2 - pacemaker-next - - - - - - - -