[Opendnssec-user] ods-kasm2html bug

Paul Wouters paul at nohats.ca
Wed Apr 2 22:42:25 UTC 2014


On Tue, 1 Apr 2014, Jakob Schlyter wrote:

> On 1 apr 2014, at 17:30, Paul Wouters <paul at nohats.ca> wrote:
>
>> It seems during build for ods-kasp2html it is checked whether xmllint and
>> xsltproc are available. If not, the XMLLINT and/or XSLTPROC variables
>> are left empty. This seems silly, you might as well just put "xmllint"
>> and "xsltproc" there, as the alternative is to not work at all anyway.
>>
>> What happens now is that if the build system does not have these, but
>> the runtime system does, ods-kaps2html does not run.
>
> I agree with your proposed fix, but I can't find a matching pull request on github - where did you submit it? ;-)

Because the world needs another abandened github clone with 1 commit in it?

See attached patch. It adds a requirement of "find" which I think is
better than adding a requirement for "which" (based on my personal
experience)

Paul
-------------- next part --------------
diff -Naur opendnssec-1.4.4-orig/tools/ods-kasp2html.in opendnssec-1.4.4/tools/ods-kasp2html.in
--- opendnssec-1.4.4-orig/tools/ods-kasp2html.in	2014-03-25 02:16:18.000000000 -0400
+++ opendnssec-1.4.4/tools/ods-kasp2html.in	2014-04-02 18:36:19.466729714 -0400
@@ -27,22 +27,27 @@
 XMLLINT=@XMLLINT@
 XSLTPROC=@XSLTPROC@
 
-KASP_SCHEMA=@OPENDNSSEC_DATA_DIR@/kasp.rng
-KASP_XSL=@OPENDNSSEC_DATA_DIR@/kasp2html.xsl
-
-KASP_XML=$1
-
-
 if [ ! -x "$XMLLINT" ]; then
-        echo "error: xmllint required, but not found"
-        exit 1
+	XMLLINT=$(find ${PATH//:/ } -maxdepth 1 -name xmllint -print -quit)
+	if [ ! -x "$XMLLINT" ]; then
+        	echo "error: xmllint required, but not found"
+        	exit 1
+	fi
 fi
 
 if [ ! -x "$XSLTPROC" ]; then
-        echo "error: xsltproc required, but not found"
-        exit 1
+	XSLTPROC=$(find ${PATH//:/ } -maxdepth 1 -name xsltproc -print -quit)
+	if [ ! -x "$XSLTPROC" ]; then
+        	echo "error: xsltproc required, but not found"
+        	exit 1
+	fi
 fi
 
+KASP_SCHEMA=@OPENDNSSEC_DATA_DIR@/kasp.rng
+KASP_XSL=@OPENDNSSEC_DATA_DIR@/kasp2html.xsl
+
+KASP_XML=$1
+
 if [ -f "$KASP_XML" ]; then
         $XMLLINT --noout --relaxng $KASP_SCHEMA $KASP_XML && \
         $XSLTPROC $KASP_XSL $KASP_XML


More information about the Opendnssec-user mailing list