Do not include () when parsing macro option definition
authorFrank Lichtenheld <flichtenheld@astaro.com>
Wed, 5 Sep 2012 09:31:30 +0000 (11:31 +0200)
committerFrank Lichtenheld <flichtenheld@astaro.com>
Wed, 5 Sep 2012 09:31:30 +0000 (11:31 +0200)
Otherwise the following warning is issued later
Odd number of elements in hash assignment at /usr/lib/build/Build/Rpm.pm line 131

Build/Rpm.pm

index fbb7dee..a04fca0 100644 (file)
@@ -286,7 +286,7 @@ reexpand:
          $line = 'MACRO';
          last;
        } elsif ($macname eq 'define' || $macname eq 'global') {
-         if ($line =~ /^\s*([0-9a-zA-Z_]+)(\([^\)]*\))?\s*(.*?)$/) {
+         if ($line =~ /^\s*([0-9a-zA-Z_]+)(?:\(([^\)]*)\))?\s*(.*?)$/) {
            my $macname = $1;
            my $macargs = $2;
            my $macbody = $3;