Let's not remove the lint target as it can still be used by older OSes
which do not support python3.

Signed-off-by: Fabiano Fidêncio <[email protected]>
---
 Makefile | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 0000306..5d904ff 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,8 @@ ARCHIVE = osinfo-db-$(TODAY).tar.xz
 
 ZANATA = zanata
 
+XMLLINT = xmllint
+
 PYTHON = python3
 
 V = 0
@@ -120,6 +122,16 @@ update-po:
           fi; \
         done
 
+lint: $(DATA_FILES) $(SCHEMA_FILES)
+       @command -v $(PYTHON) > /dev/null; \
+       if [ $$? -ne 0 ] ; then \
+         for xml in `find data -name '*.xml' | sort`; do \
+           if ! $(XMLLINT) --relaxng data/schema/osinfo.rng --noout $$xml; 
then \
+             exit 1; \
+           fi; \
+         done \
+       fi
+
 unit-tests: $(DATA_FILES) $(SCHEMA_FILES)
        @command -v $(PYTHON) > /dev/null; \
        if [ $$? -eq 0 ] ; then \
@@ -131,4 +143,4 @@ unit-tests: $(DATA_FILES) $(SCHEMA_FILES)
          echo "unit-tests are not going to be executed as no $(PYTHON) has 
been found"; \
        fi
 
-check: unit-tests
+check: lint unit-tests
-- 
2.20.1

_______________________________________________
Libosinfo mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libosinfo

Reply via email to