]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: make the check-AUTHORS test more portable, now that it's...
authorJim Meyering <meyering@redhat.com>
Thu, 23 Apr 2009 06:45:51 +0000 (08:45 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 23 Apr 2009 19:02:43 +0000 (21:02 +0200)
run as part of "make check".
* src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8.
Instead, use the French UTF8 locale, if configure found one.
If not found, just skip the test.

src/Makefile.am

index be134be0118c9aeb625e20e96e5c103c40b5ee03..a266d7b31c5928a4a2d039a446468e6477398ecf 100644 (file)
@@ -382,12 +382,17 @@ check-duplicate-no-install: tr
        test -z "`echo '$(EXTRA_PROGRAMS)'| ./tr ' ' '\n' | uniq -d`"
 
 # Ensure that the list of programs and author names is accurate.
+# We need a UTF8 locale, and any one should do, but since configure
+# already tries to find a French one, use it.  It's fine to skip this test.
 au_dotdot = authors-dotdot
 au_actual = authors-actual
 .PHONY: check-AUTHORS
 check-AUTHORS: $(all_programs)
-       @rm -f $(au_actual) $(au_dotdot)
-       @for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \
+       @locale='$(LOCALE_FR_UTF8)';                    \
+       case "$$locale" in                              \
+         ''|none) echo "$@: skipping this check"; exit 0;; esac; \
+       rm -f $(au_actual) $(au_dotdot);                \
+       for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \
            | $(ASSORT) -u`; do                         \
          test "$$i" = '[' && continue;                 \
          exe=$$i;                                      \
@@ -396,7 +401,7 @@ check-AUTHORS: $(all_programs)
          elif test "$$i" = test; then                  \
            exe='[';                                    \
          fi;                                           \
-         LC_ALL=en_US.UTF-8 ./$$exe --version          \
+         LC_ALL="$$locale" ./$$exe --version           \
            | perl -0 -pi -e 's/,\n/, /gm'              \
            | sed -n -e '/Written by /{ s//'"$$i"': /;' \
                  -e 's/,* and /, /; s/\.$$//; p; }';   \