check: Switch CRLF line ending check to use perl
authorJan Schmidt <jan.schmidt@sun.com>
Tue, 26 May 2009 10:22:55 +0000 (11:22 +0100)
committerJan Schmidt <jan.schmidt@sun.com>
Tue, 26 May 2009 10:22:55 +0000 (11:22 +0100)
Apparently only GNU file differentiates between text files with different
line ending styles, so this test breaks on Solaris. Use a small perl
fragment instead.

win32.mak

index e5192b9..d9964a3 100644 (file)
--- a/win32.mak
+++ b/win32.mak
@@ -24,7 +24,8 @@ win32-check-crlf:
        @echo Checking win32 files for CR LF line endings ...; \
        fail=0 ; \
        for each in $(win32crlf) ; do \
-         if ! (file $$each | grep CRLF >/dev/null) ; then \
+         result=`perl -e 'print grep(/\r\n/,<>)' "$$each" | wc -l`; \
+         if test "$$result" = 0 ; then \
            echo $$each must be fixed to have CRLF line endings ; \
            fail=1; \
          fi ; \