summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'files/mirrors/Makefile')
-rw-r--r--files/mirrors/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/files/mirrors/Makefile b/files/mirrors/Makefile
new file mode 100644
index 00000000..621742c6
--- /dev/null
+++ b/files/mirrors/Makefile
@@ -0,0 +1,25 @@
+.%.expected-format.xml: %.xml
+ xmllint --format $^ > $@
+
+.ONESHELL:
+.%.expected-format.xml.ok: SHELL = /bin/bash
+.%.expected-format.xml.ok: .%.expected-format.xml
+ if ! cmp -s $*.xml $^; then
+ diff -u $*.xml $^
+ exit 1
+ fi
+ touch $@
+
+.PHONY: check
+check: .distfiles.expected-format.xml.ok .rsync.expected-format.xml.ok
+
+.PHONY: format
+.ONESHELL:
+format: SHELL = /bin/bash
+format:.distfiles.expected-format.xml .rsync.expected-format.xml
+ for FILE in distfiles rsync; do
+ if cmp -s "$${FILE}.xml" ".$${FILE}.expected-format.xml"; then
+ continue
+ fi
+ cp ".$${FILE}.expected-format.xml" "$${FILE}.xml"
+ done