summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-07-25 08:37:28 -0700
committerJim Meyering <meyering@fb.com>2016-07-27 09:31:03 -0700
commit5e6911ccd617b4182f59d2282db7e8f59a8ebb33 (patch)
tree12f705b154374543109cba3f055b4a60aa5e6fb6
parent8d1b1630800ee339ce635647500d5b5943b37e4d (diff)
downloadcoreutils-5e6911ccd617b4182f59d2282db7e8f59a8ebb33.tar.xz
maint: skip a check when en_US.UTF-8 collation rules are broken
* cfg.mk (sc_THANKS_in_sorted): This check would fail on systems for which "." is not ignored. Add a quick sort-based check for that error, and skip the check on any broken system.
-rw-r--r--cfg.mk25
1 files changed, 16 insertions, 9 deletions
diff --git a/cfg.mk b/cfg.mk
index c917c874f..08d9e9dd4 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -722,15 +722,22 @@ sc_THANKS_in_duplicates:
&& { echo '$(ME): remove the above names from THANKS.in' \
1>&2; exit 1; } || :
-# Ensure the contributor list stays sorted. Use our sort as other
-# implementations may result in a different order.
-sc_THANKS_in_sorted: src/sort
- @sed '/^$$/,/^$$/!d;/^$$/d' $(srcdir)/THANKS.in > $@.1; \
- LC_ALL=en_US.UTF-8 src/sort -f -k1,1 $@.1 > $@.2
- @diff -u $@.1 $@.2; diff=$$?; \
- rm -f $@.1 $@.2; \
- test "$$diff" = 0 \
- || { echo '$(ME): THANKS.in is unsorted' 1>&2; exit 1; }
+# Ensure the contributor list stays sorted. However, if the system's
+# en_US.UTF-8 locale data is erroneous, give a diagnostic and skip
+# this test. This affects OS X, up to at least 10.11.6.
+# Use our sort as other implementations may result in a different order.
+sc_THANKS_in_sorted:
+ @printf 'a\n.b\n'|LC_ALL=en_US.UTF-8 src/sort -c 2> /dev/null \
+ && { \
+ sed '/^$$/,/^$$/!d;/^$$/d' $(srcdir)/THANKS.in > $@.1 && \
+ LC_ALL=en_US.UTF-8 src/sort -f -k1,1 $@.1 > $@.2 && \
+ diff -u $@.1 $@.2; diff=$$?; \
+ rm -f $@.1 $@.2; \
+ test "$$diff" = 0 \
+ || { echo '$(ME): THANKS.in is unsorted' 1>&2; exit 1; }; \
+ } \
+ || { echo '$(ME): this system has erroneous locale data;' \
+ 'skipping $@' 1>&2; }
# Look for developer diagnostics that are marked for translation.
# This won't find any for which devmsg's format string is on a separate line.