From 71514bfeb11a1a7058b2714e5df08f329e20d489 Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Tue, 26 May 2020 21:02:00 +0200 Subject: [PATCH] Check schema correctness also with libxml2/xmllint Why both? The stars show their strong points: | | jing | xmllint | |----------------------------+-----------+-----------------| | runtime dependencies | big (JRE) | * small (glibc) | | detects invalid documents | yes | yes | | explains what is wrong | | | | ... with invalid documents | * yes | no | --- Dockerfile | 1 + package/yast2-schema.changes | 1 + package/yast2-schema.spec | 1 + src/rng/Makefile.am | 1 + 4 files changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 181a89d..2e6b012 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM registry.opensuse.org/yast/head/containers/yast-ruby:latest RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \ autoyast2 \ + libxml2-tools \ jing \ trang \ yast2 \ diff --git a/package/yast2-schema.changes b/package/yast2-schema.changes index 179b9d1..7ca96cb 100644 --- a/package/yast2-schema.changes +++ b/package/yast2-schema.changes @@ -2,6 +2,7 @@ Thu May 7 16:13:37 UTC 2020 - Imobach Gonzalez Sosa - Allow optional types for string and map objects (bsc#1170886). +- Check schema correctness with jing and xmllint (bsc#1172131). - 4.3.0 ------------------------------------------------------------------- diff --git a/package/yast2-schema.spec b/package/yast2-schema.spec index c159f08..8a48815 100644 --- a/package/yast2-schema.spec +++ b/package/yast2-schema.spec @@ -30,6 +30,7 @@ Url: https://github.com/yast/yast-schema # Dependencies needed to build the package BuildRequires: jing +BuildRequires: libxml2-tools BuildRequires: trang yast2-devtools # All packages providing RNG files for AutoYaST diff --git a/src/rng/Makefile.am b/src/rng/Makefile.am index 91aae54..2762c18 100644 --- a/src/rng/Makefile.am +++ b/src/rng/Makefile.am @@ -19,6 +19,7 @@ clean-local: # Test with a minimal valid profile that the schema is correct check-local: echo '' | jing profile.rng /dev/stdin + echo '' | xmllint --noout --relaxng profile.rng /dev/stdin install-data-local: $(INSTALL) -d $(DESTDIR)$(schemadir)/autoyast/rng