fedora-comps/Makefile
Dennis Gilmore 0c34ec44e1 add sort target to Makefile and sort
As people are always getting things out of order in comps. add a make
target that sorts all the comps files, this way people can just run
"make sort" when making changes, and we can add a jenkins job that
will fail and mark a PR as bad for unsorted commits. As the comps
files are really badly sorted now there is some massive change for
EOL comps fils in here. but the run is needed so we can pass going
forward

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2017-04-11 19:21:30 -05:00

34 lines
922 B
Makefile

XMLINFILES=$(wildcard *.xml.in)
XMLFILES = $(patsubst %.xml.in,%.xml,$(XMLINFILES))
all: po $(XMLFILES)
po: $(XMLINFILES)
make -C po -f Makefile || exit 1
clean:
@rm -fv *~ *.xml
validate: $(XMLFILES) comps.rng
# 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
sort:
# Run xsltproc on each xml.in file and exit with non-zero if any sorting fails
RES=0; for f in $(XMLINFILES); do \
xsltproc --novalid -o $$f comps-cleanup.xsl $$f; \
RES=$$(($$RES + $$?)); \
done; exit $$RES
%.xml: %.xml.in
@xmllint --noout $<
@if test ".$(CLEANUP)" == .yes; then xsltproc --novalid -o $< comps-cleanup.xsl $<; fi
./update-comps $@
# Add an easy alias to generate a rawhide comps file
comps-rawhide.xml comps-rawhide: comps-f27.xml
@mv comps-f27.xml comps-rawhide.xml