git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator
@ 2010-01-20 19:23 Ramsay Jones
  2010-01-20 20:57 ` Pete Harlan
  2010-01-20 22:54 ` Sebastian Schuberth
  0 siblings, 2 replies; 5+ messages in thread
From: Ramsay Jones @ 2010-01-20 19:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, sschuberth, GIT Mailing-list


Commit ade2ca0c (Do not try to remove directories when removing
old links, 27-10-2009) added an expression to a 'test' using an
'-o' or connective. This resulted in the buildsystem generator
mistaking the conditional 'rm' for a linker command. In order
to fix the breakage, we filter the out the conditional 'rm'
commands before attempting to identify other commands.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 contrib/buildsystems/engine.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index d506717..245af73 100644
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -135,6 +135,11 @@ sub parseMakeOutput
             }
         } while($ate_next);
 
+        if ($text =~ /^test / && $text =~ /|| rm -f /) {
+            # commands removing executables, if they exist
+            next;
+        }
+
         if($text =~ / -c /) {
             # compilation
             handleCompileLine($text, $line);
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator
  2010-01-20 19:23 [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator Ramsay Jones
@ 2010-01-20 20:57 ` Pete Harlan
  2010-01-22 18:58   ` Ramsay Jones
  2010-01-20 22:54 ` Sebastian Schuberth
  1 sibling, 1 reply; 5+ messages in thread
From: Pete Harlan @ 2010-01-20 20:57 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, Johannes Sixt, sschuberth, GIT Mailing-list

On 01/20/2010 11:23 AM, Ramsay Jones wrote:
> diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
> index d506717..245af73 100644
> --- a/contrib/buildsystems/engine.pl
> +++ b/contrib/buildsystems/engine.pl
> @@ -135,6 +135,11 @@ sub parseMakeOutput
>              }
>          } while($ate_next);
>  
> +        if ($text =~ /^test / && $text =~ /|| rm -f /) {

That test on the right needs to escape its pipes or it will always match.

--Pete

> +            # commands removing executables, if they exist
> +            next;
> +        }
> +
>          if($text =~ / -c /) {
>              # compilation
>              handleCompileLine($text, $line);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator
  2010-01-20 19:23 [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator Ramsay Jones
  2010-01-20 20:57 ` Pete Harlan
@ 2010-01-20 22:54 ` Sebastian Schuberth
  2010-01-22 19:40   ` Ramsay Jones
  1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Schuberth @ 2010-01-20 22:54 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list

On 20.01.2010 20:23, Ramsay Jones wrote:

 > '-o' or connective. This resulted in the buildsystem generator
 > mistaking the conditional 'rm' for a linker command. In order

Thanks for spotting the cause of this! Some comments:

1. How about deleting lines 183-185 in same run? That commented out 
code, too, is missing the escapes for the pipes that Pete mentioned anyway.

-#        } elsif ($text =~ /^test / && $text =~ /|| rm -f /) {
-#            # commands removing executables, if they exist
-#


2. Couldn't we reduce the test to just

+        if ($text =~ /^test /) {
+            # options to test may be mistaken for linker options
+            next;
+        }
+

3. If the above won't do for some reason, I'd still prefer something like

+        if ($text =~ /^test / && $text =~ / -o /) {
+            # options to test may be mistaken for linker options
+            next;
+        }
+

as it makes more clear what's the problem in such lines.

-- 
Sebastian Schuberth

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator
  2010-01-20 20:57 ` Pete Harlan
@ 2010-01-22 18:58   ` Ramsay Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2010-01-22 18:58 UTC (permalink / raw)
  To: Pete Harlan; +Cc: Junio C Hamano, Johannes Sixt, sschuberth, GIT Mailing-list

Pete Harlan wrote:
> On 01/20/2010 11:23 AM, Ramsay Jones wrote:
>> diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
>> index d506717..245af73 100644
>> --- a/contrib/buildsystems/engine.pl
>> +++ b/contrib/buildsystems/engine.pl
>> @@ -135,6 +135,11 @@ sub parseMakeOutput
>>              }
>>          } while($ate_next);
>>  
>> +        if ($text =~ /^test / && $text =~ /|| rm -f /) {
> 
> That test on the right needs to escape its pipes or it will always match.

Heh, well spotted!
As you may have already noticed, I copy/pasted the code from the comment
further down in this function, but didn't take enough care in doing so...
Oops! ;-)

The obvious solution, also suggested later by Sebastion, is to simply
remove the second regex from the test since it does not alter the
outcome (and still fixes the problem)...

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator
  2010-01-20 22:54 ` Sebastian Schuberth
@ 2010-01-22 19:40   ` Ramsay Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Ramsay Jones @ 2010-01-22 19:40 UTC (permalink / raw)
  To: Sebastian Schuberth; +Cc: Junio C Hamano, Johannes Sixt, GIT Mailing-list

Sebastian Schuberth wrote:
> On 20.01.2010 20:23, Ramsay Jones wrote:
> 
>  > '-o' or connective. This resulted in the buildsystem generator
>  > mistaking the conditional 'rm' for a linker command. In order
> 
> Thanks for spotting the cause of this! Some comments:
> 
> 1. How about deleting lines 183-185 in same run? That commented out 
> code, too, is missing the escapes for the pipes that Pete mentioned anyway.
> 
> -#        } elsif ($text =~ /^test / && $text =~ /|| rm -f /) {
> -#            # commands removing executables, if they exist
> -#

OK, will do.

> 
> 2. Couldn't we reduce the test to just
> 
> +        if ($text =~ /^test /) {
> +            # options to test may be mistaken for linker options
> +            next;
> +        }
> +

Yes, good idea.  I will send a new version of the patch soon.

Thanks!

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-22 20:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 19:23 [PATCH 1/4] engine.pl: Fix a recent breakage of the buildsystem generator Ramsay Jones
2010-01-20 20:57 ` Pete Harlan
2010-01-22 18:58   ` Ramsay Jones
2010-01-20 22:54 ` Sebastian Schuberth
2010-01-22 19:40   ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).