bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 63.


From: Bruno Haible
Subject: Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 63.
Date: Sun, 17 Mar 2024 23:40:12 +0100

Hi Collin,

> This patch is just one added function. Can you double check that I
> understood your 'sed' wizardry correctly Bruno?

Yes. You even added support for nested 'if's, which the original doesn't have.
Nice.

> I placed the sed command and a modified version of my Python function in
> two scripts and compared their output using 'modules/stdio'. They
> produced the same output.
> 
> The cleansed.append('') call seemed to make them output the same
> number of newlines. It looks a bit strange, but that is my reasoning
> for it

I now tried to make the blank line go away. But that's not trivial to do
on the shell side. So, let's keep these blank lines.

The blank lines come from the 'endif' line, with the starting 'endif' removed.
I reflected that in the Python code and pushed the modified patch:

            if line.startswith('if '):
                depth += 1
            elif line.startswith('endif'):
                depth -= 1
                # Make sure gnulib-tool.py and gnulib-tool.sh produce the same
                # output.
                cleansed.append(line[5:])

Thanks!

Bruno






reply via email to

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