[PATCH kmod 01/20] man: add script to generate/compare the xslt vs upcoming scdoc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Emil Velikov <emil.l.velikov@xxxxxxxxx>

Signed-off-by: Emil Velikov <emil.l.velikov@xxxxxxxxx>
---
 man/compare.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/man/compare.sh b/man/compare.sh
new file mode 100755
index 0000000..7579ab5
--- /dev/null
+++ b/man/compare.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+the_sed()
+{
+	sed -e 's|@DISTCONFDIR@|/TEST|g;s|@MODULE_DIRECTORY@|/TEST|g' $1
+}
+
+gen_xslt()
+{
+			#--output ${xml//.xml}.xslt \
+			#--noout \
+	for xml in *xml; do
+		the_sed $xml | xsltproc \
+			--stringparam man.output.quietly 1 \
+			--param funcsynopsis.style "'ansi'" \
+			http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl -
+		# The output and noout args seems cosmetic, sigh
+		mv ${xml//.xml}{,.xslt}
+	done
+}
+
+gen_scdoc()
+{
+	for scd in *scd; do
+		the_sed $scd | scdoc > ${scd//.scd}.scdoc
+	done
+}
+
+comp_output()
+{
+	export LESS='-F -i -M -R -S -w -X -z-4'
+	unset MANPAGER
+
+	for xslt in $(ls --sort=version *xslt); do
+		_name=${xslt//.xslt}
+
+		echo "Checking $_name"
+
+		diff --unified --color=always \
+			<(man ./$_name.xslt) \
+			<(man ./$_name.scdoc) | less
+
+		read
+	done
+}
+
+comp_raw()
+{
+	for xslt in *xslt; do
+		_name=${xslt//.xslt}
+
+		diff --unified --color=always ./$_name.{xslt,scdoc}
+	done
+}
+
+time gen_xslt
+time gen_scdoc
+
+comp_output
+#comp_raw
+
+rm -f *xslt
+rm -f *scdoc

-- 
2.45.0






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux