From c7844b4dae00b18ffd482091d600d0b57630dc27 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgordon@gmail.com>
Date: Thu, 8 Jan 2015 01:20:06 -0500
Subject: [PATCH] maint: skip long-lines syntax-check if needed

* cfg.mk: skip 'sc_long_lines' if GNU wc/sed are missing.
---
 cfg.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cfg.mk b/cfg.mk
index 988ad62..91045b8 100644
--- 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						\
-- 
2.1.3

