Hi Collin,

> The shell script checks if an Automake snippet is non-empty by doing this:
> 
> if grep '[^    ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /dev/null ; then

... which tests whether the combination of the two snippets contains some
character that is not newline, not space, and not tab.

> But the Python script checks that the entire snippet is space
> characters.

... which is a faithful translation to Python of the shell code above.

> I've simply added this function:
> 
> def _is_nonempty_snippet(snippet: str) -> bool:
>     '''Returns True if an Automake snippet is not empty, else False.'''
>     for line in snippet.splitlines():
>         if line != '' and not (line.startswith(' ') or line.startswith('\t')):
>             return True
>     return False

But this is not what the shell script does.

There must be something else going on. Probably in the code for conditional
module dependencies.

Bruno




Reply via email to