]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
syntax-check: Introduce sc_linguas_sorting
authorAndrea Bolognani <abologna@redhat.com>
Mon, 16 May 2022 18:35:21 +0000 (20:35 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 23 May 2022 11:58:29 +0000 (13:58 +0200)
Make sure LINGUAS remains sorted correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
build-aux/syntax-check.mk

index 513c147cec2c8bd5987ece43b684aa6cbbcf921f..6b54f830f1e01eeffa6360b3f532e225dc84d284 100644 (file)
@@ -1502,6 +1502,14 @@ sc_po_check:
          rm -f $@-1 $@-2;                                              \
        fi
 
+linguas_file = $(top_srcdir)/po/LINGUAS
+
+sc_linguas_sorting:
+       @sort -u $(linguas_file) > $@-1; \
+       diff -u -L $(linguas_file) -L $(linguas_file) $(linguas_file) $@-1 \
+         || { echo "$(linguas_file) is not sorted correctly" 1>&2; exit 1; }; \
+       rm -f $@-1
+
 # #if WITH_... will evaluate to false for any non numeric string.
 # That would be flagged by using -Wundef, however gnulib currently
 # tests many undefined macros, and so we can't enable that option.