Non-zero exit on validation failure

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-05-18 14:52:40 +02:00
parent 01f79df1ef
commit b415f639f9
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@ clean:
@rm -fv *~ *.xml
validate: $(XMLFILES) comps.rng
for f in $(XMLFILES); do xmllint --noout --relaxng comps.rng $$f; done
# Run xmllint on each file and exit with non-zero if any validation fails
RES=0; for f in $(XMLFILES); do \
xmllint --noout --relaxng comps.rng $$f; \
RES=$$(($$RES + $$?)); \
done; exit $$RES
%.xml: %.xml.in
@xmllint --noout $<