bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch] Avoid some of the sc_ rules to freeze


From: Pádraig Brady
Subject: Re: [patch] Avoid some of the sc_ rules to freeze
Date: Mon, 22 Feb 2010 13:40:35 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

On 21/02/10 13:43, address@hidden wrote:

Hi.

Just another little patch to avoid some of the sc_* rules to freeze if
the filtering of VC_LIST_EXCEPT gives an empty string (for example,
'make sc_error_exit_success' freezes if there are not source files in
${srcdir}/).

I found this problem due to the bazaar issue in vc-list-files.


2010-02-21  Jose E. Marchesi<address@hidden>

        * top/maint.mk (sc_error_exit_success): Apply the rule only if the
        filtering of VC_LIST_EXCEPT is not empty.  Otherwise the main grep
        freezes waiting for data in the standard input.
        (sc_makefile_TAB_only_indentation): Likewise.
        (sc_makefile_path_separator_check): Likewise.
        (sc_m4_quote_check): Likewise.

diff --git a/top/maint.mk b/top/maint.mk
index 7d84b6c..11afe6b 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -217,9 +217,13 @@ sc_prohibit_magic_number_exit:
  # Using EXIT_SUCCESS as the first argument to error is misleading,
  # since when that parameter is 0, error does not exit.  Use `0' instead.
  sc_error_exit_success:
-       @grep -nE 'error \(EXIT_SUCCESS,'                               \
-           $$($(VC_LIST_EXCEPT) | grep -E '\.[chly]$$')&&              \
-         { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; exit 1; } || :
+       @if $(VC_LIST_EXCEPT) | grep -E '\.[chly]$$'>  /dev/null; then  \
+         grep -nE 'error \(EXIT_SUCCESS,'                              \
+               $$($(VC_LIST_EXCEPT) | grep -E '\.[chly]$$')&&          \
+         { echo '$(ME): found error (EXIT_SUCCESS'                     \
+               1>&2; exit 1; } || :;                                    \
+       else :;                                                         \
+       fi

Would it be better to just add /dev/null as a parameter to grep?
I.E. like:

        @grep -nE 'error \(EXIT_SUCCESS,'                               \
            $$($(VC_LIST_EXCEPT) /dev/null | grep -E '\.[chly]$$')&&    \
          { echo '$(ME): found error (EXIT_SUCCESS' 1>&2; exit 1; } || :

cheers,
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]