]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: skip long-lines syntax-check if unsupported
authorAssaf Gordon <assafgordon@gmail.com>
Thu, 8 Jan 2015 06:20:06 +0000 (01:20 -0500)
committerPádraig Brady <P@draigBrady.com>
Thu, 8 Jan 2015 12:42:29 +0000 (12:42 +0000)
* cfg.mk(sc_long_lines): Skip if required wc and sed options
are not supported, which is currently the case on OS X.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 988ad62dd5493601f840f9e43cd3fc2b199fa97c..91045b852efc0f4b72b30bc46d623e1b6ec2d40b 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -245,7 +245,11 @@ FILTER_LONG_LINES =                                                \
   \|^[^:]*tests/misc/sha[0-9]*sum.*\.pl[-:]| d;                        \
   \|^[^:]*tests/pr/|{ \|^[^:]*tests/pr/pr-tests:| !d; };
 sc_long_lines:
-       @files=$$($(VC_LIST_EXCEPT) | xargs wc -L | sed -rn '/ total$$/d;\
+       @wc -L /dev/null >/dev/null 2>/dev/null                         \
+          || { echo "$@: skipping: wc -L not supported"; exit 0; };    \
+       sed -r 1q /dev/null 2>/dev/null                                 \
+          || { echo "$@: skipping: sed -r not supported"; exit 0; };   \
+       files=$$($(VC_LIST_EXCEPT) | xargs wc -L | sed -rn '/ total$$/d;\
                  s/^ *(8[1-9]|9[0-9]|[0-9]\{3,\}) //p');               \
        halt='line(s) with more than 80 characters; reindent';          \
        for file in $$files; do                                         \