diff contrib/check-code.py @ 19626:cf6b086d64cc

solaris: test cases can't use grep -a The -a option to GNU grep isn't available when using Solaris grep. Replace the one use of grep -a in the testsuite with some in-line Python that does the equivalent, and add a check for grep -a in check-code.py.
author Danek Duvall <danek.duvall@oracle.com>
date Fri, 23 Aug 2013 14:31:42 -0700
parents 725507cd5216
children 3193b23eec61
line wrap: on
line diff
--- a/contrib/check-code.py	Mon Aug 19 11:25:23 2013 -0700
+++ b/contrib/check-code.py	Fri Aug 23 14:31:42 2013 -0700
@@ -61,6 +61,7 @@
     (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"),
     (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"),
     (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"),
+    (r'(?<!hg )grep.*-a', "don't use 'grep -a', use in-line python"),
     (r'sed.*-i', "don't use 'sed -i', use a temporary file"),
     (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"),
     (r'echo -n', "don't use 'echo -n', use printf"),