cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [cluster][PATCH] rng: {for, back}ward-compat support for more strict RA validation
@ 2013-12-16 17:18 Jan Pokorný
  2013-12-17 14:39 ` [Cluster-devel] [PATCH v2] " Jan Pokorný
  2013-12-17 16:16 ` [Cluster-devel] [cluster][PATCH] " Jan Pokorný
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Pokorný @ 2013-12-16 17:18 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This is to complement resource-agents changeset [1].

[1] http://www.redhat.com/archives/cluster-devel/2013-December/msg00125.html

Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
 config/tools/xml/ccs_update_schema.in | 43 ++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/config/tools/xml/ccs_update_schema.in b/config/tools/xml/ccs_update_schema.in
index 98ed885..d959735 100644
--- a/config/tools/xml/ccs_update_schema.in
+++ b/config/tools/xml/ccs_update_schema.in
@@ -211,19 +211,36 @@ generate_ras() {
 
 	cat $rngdir/resources.rng.head > "$outputdir/resources.rng.cache"
 	lecho " ras: generating rng data"
-	for i in $raslist; do
-		lecho " ras: processing $(basename $i)"
-		$i meta-data 2>/dev/null | xsltproc $rngdir/ra2rng.xsl - >> \
-			"$outputdir/resources.rng.cache" 2>/dev/null
-	done
-	cat $rngdir/resources.rng.mid >> "$outputdir/resources.rng.cache"
-	lecho " ras: generating ref data"
-	for i in $raslist; do
-		lecho " ras: processing $(basename $i)"
-		$i meta-data 2>/dev/null | xsltproc $rngdir/ra2ref.xsl - >> \
-			"$outputdir/resources.rng.cache" 2>/dev/null
-	done
-	cat $rngdir/resources.rng.tail >> "$outputdir/resources.rng.cache"
+	if [ -r $rngdir/ra2rng-postprocess.xsl ]; then
+		# use new logic for dynamic content + tail
+		{ echo '<rha:wrap xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_namespace">';
+		  for i in $raslist; do
+		    lecho " ras: processing $(basename $i)" >&2
+		    $i meta-data 2>/dev/null | xsltproc ra2rng.xsl - 2>/dev/null
+		  done
+		  echo '</rha:wrap>'; } \
+		| xsltproc ra2rng-postprocess.xsl - \
+		| sed -e '/\s*<[\/]\?rha:wrap[^>]*>\s*/d' >> \
+			"$outputdir/resources.rng.cache"
+		sed -ne '/<\/rha:ignore>/bI;d;:I;n;p;bI' \
+			$rngdir/resources.rng.tail >> \
+			"$outputdir/resources.rng.cache"
+	else
+		# stick with old logic for dynamic content + tail
+		for i in $raslist; do
+			lecho " ras: processing $(basename $i)"
+			$i meta-data 2>/dev/null | xsltproc $rngdir/ra2rng.xsl - >> \
+				"$outputdir/resources.rng.cache" 2>/dev/null
+		done
+		cat $rngdir/resources.rng.mid >> "$outputdir/resources.rng.cache"
+		lecho " ras: generating ref data"
+		for i in $raslist; do
+			lecho " ras: processing $(basename $i)"
+			$i meta-data 2>/dev/null | xsltproc $rngdir/ra2ref.xsl - >> \
+				"$outputdir/resources.rng.cache" 2>/dev/null
+		done
+		cat $rngdir/resources.rng.tail >> "$outputdir/resources.rng.cache"
+	fi
 }
 
 create_fas_stubs() {
-- 
1.8.1.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-17 16:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-16 17:18 [Cluster-devel] [cluster][PATCH] rng: {for, back}ward-compat support for more strict RA validation Jan Pokorný
2013-12-17 14:39 ` [Cluster-devel] [PATCH v2] " Jan Pokorný
2013-12-17 16:16 ` [Cluster-devel] [cluster][PATCH] " Jan Pokorný

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).