]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2750] change xq to xmllint and check if in path
authorAndrei Pavel <andrei@isc.org>
Tue, 3 Oct 2023 13:40:33 +0000 (16:40 +0300)
committerAndrei Pavel <andrei@isc.org>
Fri, 6 Oct 2023 07:07:14 +0000 (10:07 +0300)
- also make makefile rules in doc/sphinx/uml silent to make the
  potential warning visible
- also remove trailing spaces automatically from *.atxt files

configure.ac
doc/sphinx/Makefile.am

index 346a36cf6124d5ef8b53c449905ea6bf166699d7..4d554da8e9ea746ac77162470af4ea96eac9ed1c 100644 (file)
@@ -1383,6 +1383,10 @@ AM_CONDITIONAL(HAVE_ASCIIDOC, test "x$ASCIIDOC" != "xno")
 AC_PATH_PROG(PLANTUML, plantuml, no)
 AM_CONDITIONAL(HAVE_PLANTUML, test "x$PLANTUML" != "xno")
 
+# Check for xmllint.
+AC_PATH_PROG(XMLLINT, xmllint, no)
+AM_CONDITIONAL(HAVE_XMLLINT, test "x$XMLLINT" != "xno")
+
 # Check for valgrind
 AC_PATH_PROG(VALGRIND, valgrind, no)
 AM_CONDITIONAL(HAVE_VALGRIND, test "x$VALGRIND" != "xno")
index 62cf7490d788480e3e8182df6eb1cec626367170..967b32bc26d99bf9027573a4e5a7d0b2584180b1 100644 (file)
@@ -144,20 +144,31 @@ svgs += uml/select4.svg
 svgs += uml/tkey.svg
 svgs += uml/update.svg
 
+txts  =
+txts += uml/option-data-priority.atxt
+txts += uml/priority-of-lease-lifetimes-and-dhcpv4-fields.atxt
+txts += uml/tkey.atxt
+txts += uml/update.atxt
+
 if HAVE_PLANTUML
 uml: uml-to-png uml-to-svg format-svgs uml-to-txt
 
 uml-to-png: $(umls)
-       @PLANTUML@ -tpng $^
+       @ @PLANTUML@ -tpng $^
 
 uml-to-svg: $(umls)
-       @PLANTUML@ -tsvg $^
+       @ @PLANTUML@ -tsvg $^
 
 format-svgs: $(svgs)
-       for svg in $(svgs); do xq -x . $$svg > tmp; mv tmp $$svg; done
+if HAVE_XMLLINT
+       @ for svg in $(svgs); do xmllint --format $$svg > tmp; mv tmp $$svg; done
+else
+       @ printf 'WARNING: xmllint not found. SVGs not formatted.\n'
+endif
 
 uml-to-txt: $(umls)
-       @PLANTUML@ -ttxt $^
+       @ @PLANTUML@ -ttxt $^
+       for txt in $(txts); do sed 's/ *$$//g' $$txt > tmp; mv tmp $$txt; done
 endif
 
 EXTRA_DIST += $(umls)