]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
maint: avoid a false-positive syntax-check failure
authorJim Meyering <meyering@meta.com>
Wed, 27 Dec 2023 15:48:17 +0000 (07:48 -0800)
committerJim Meyering <meyering@meta.com>
Wed, 27 Dec 2023 15:48:17 +0000 (07:48 -0800)
* maintainer/syntax-checks.mk (sc_tests_plain_sleep): This would match
the "sleep 1" in a comment.  So filter out shell-style comments before
matching.

maintainer/syntax-checks.mk

index c5631378128d8db5441ef7dd228c03d3123c4c0e..40e30d955189b7379027df8cd5a87e4ba08c7f42 100644 (file)
@@ -440,7 +440,8 @@ sc_tests_ls_t:
 # Use '$sleep' instead.  Some file systems (e.g., Windows) have only
 # a 2sec resolution.
 sc_tests_plain_sleep:
-       @if grep -E '\bsleep +[12345]\b' $(xtests); then \
+       @if grep -vE '^[        ]*#' $(xtests) \
+             | grep -E '\bsleep +[12345]\b' | grep .; then \
          echo 'Do not use "sleep x" in the above tests.  Use "$$sleep" instead.' 1>&2; \
          exit 1; \
        fi