From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Pokorný Date: Mon, 16 Dec 2013 17:57:26 +0100 Subject: [Cluster-devel] [PATCHv4 2/2] rgmanager: ra2rng.xsl et al.: enforce "forbid child" from RA metadata In-Reply-To: <1387208131-20404-1-git-send-email-jpokorny@redhat.com> References: <1387208131-20404-1-git-send-email-jpokorny@redhat.com> Message-ID: <1387213046-15232-1-git-send-email-jpokorny@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit As with previous change, the reflection of this change is yet to come to cluster.git (ccs_update_schema script) via a separate patch. There is a new file included in "DIST", ra2rng-postprocess.xsl, that is to be appended to a pipe with original ra2rng.xsl (both with xsltproc as an effective actor, indeed), that in turn now requires some extra decoration as can be found also in the respective Makefile.am. In netfs.sh, the order of forbidden children in metadata now follows alphabetical ordering, which is in-line with other such occurrences in RAs metadata. Also note that this provision to schema generation will not work properly until libxslt bugfix [1] is propagated to the target deployment. [1] https://mail.gnome.org/archives/xslt/2013-December/msg00001.html Signed-off-by: Jan Pokorn? --- rgmanager/src/resources/Makefile.am | 22 +- rgmanager/src/resources/netfs.sh | 2 +- rgmanager/src/resources/ra2rng-postprocess.xsl | 290 +++++++++++++++++++++++++ rgmanager/src/resources/ra2rng.xsl | 12 + 4 files changed, 317 insertions(+), 9 deletions(-) create mode 100644 rgmanager/src/resources/ra2rng-postprocess.xsl diff --git a/rgmanager/src/resources/Makefile.am b/rgmanager/src/resources/Makefile.am index caeb947..d26861c 100644 --- a/rgmanager/src/resources/Makefile.am +++ b/rgmanager/src/resources/Makefile.am @@ -41,7 +41,7 @@ HELPERS = ocf-shellfuncs svclib_nfslock \ DTD = ra-api-1-modified.dtd -XSL = ra2man.xsl ra2ref.xsl ra2rng.xsl +XSL = ra2man.xsl ra2ref.xsl ra2rng.xsl ra2rng-postprocess.xsl RESRNG = resources.rng.head resources.rng.mid resources.rng.tail @@ -99,20 +99,26 @@ ras-validation: $(RESOURCES) $(TARGET) $(DTD) # NOTE: resources.rng.mid and resources.rng.tail not joined for # compatibility with obsolete 2-passes-logic of # ccs_update_schema script from external cman package +# (new logic part behaves just like this recipe) # # XXX: race-prone in parallel make # resources.rng: $(RESOURCES) $(TARGET) utils/config-utils.sh resources.rng: $(XSL) $(RESRNG) rm -f resources.rng - cat resources.rng.head >> resources.rng @echo Generating per-resource RelaxNG information... - @for f in $(RESOURCES) $(TARGET); do \ - echo " ./$$f"; \ - bash ./$$f meta-data | xsltproc ra2rng.xsl - >> resources.rng; \ - done - cat resources.rng.mid >> resources.rng - cat resources.rng.tail >> resources.rng + cat resources.rng.head >> resources.rng + @{ echo ''; \ + for f in $(RESOURCES) $(TARGET); do \ + echo " ./$$f" >&2; \ + bash ./$$f meta-data | xsltproc ra2rng.xsl -; \ + done; \ + echo ''; } \ + | xsltproc ra2rng-postprocess.xsl - \ + | sed -e '/\s*<[\/]\?rha:wrap[^>]*>\s*/d' \ + >> resources.rng + sed -ne '/<\/rha:ignore>/bI;d;:I;n;p;bI' resources.rng.tail \ + >> resources.rng utils/config-utils.sh: make -C utils config-utils.sh diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh index 5dad993..46ad3b1 100755 --- a/rgmanager/src/resources/netfs.sh +++ b/rgmanager/src/resources/netfs.sh @@ -173,8 +173,8 @@ do_metadata() - + EOT diff --git a/rgmanager/src/resources/ra2rng-postprocess.xsl b/rgmanager/src/resources/ra2rng-postprocess.xsl new file mode 100644 index 0000000..3772ab2 --- /dev/null +++ b/rgmanager/src/resources/ra2rng-postprocess.xsl @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl index 5b9a307..71df682 100644 --- a/rgmanager/src/resources/ra2rng.xsl +++ b/rgmanager/src/resources/ra2rng.xsl @@ -489,6 +489,18 @@ + + + + + + + + + -- 1.8.1.4