Changeset 98
- Timestamp:
- 05/11/07 13:49:18 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/debbuild
r97 r98 60 60 my %specglobals; # For %define's in specfile, among other things. 61 61 62 $specglobals{'_vendor'} = 'debbuild'; 63 62 64 # Initialized globals 63 65 my $verbosity = 0; … … 442 444 if (/^\%if/) { 443 445 s/^\%if//; 446 chomp; 444 447 my $expr = expandmacros($_, 'g'); 445 448 $iflevel++; 449 450 if ($expr !~ /^\s*\d+\s*$/) { 451 # gots a logic statement we want to turn into a 1 or a 0. most likely by eval'ing it. 452 453 $expr =~ s/\s+//g; 454 $expr =~ s/^(\w+)/"$1"/ if $expr !~ /^['"]\w['"]/; 455 $expr =~ s/(\w+)$/"$1"/ if $expr !~ /['"]\w['"]$/; 456 457 # Done in this order so we don't cascade incorrectly. Yes, those spaces ARE correct in the replacements! 458 $expr =~ s/==/ eq /; 459 $expr =~ s/!=/ ne /; 460 $expr =~ s/<=>/ cmp /; 461 $expr =~ s/<=/ le /; 462 $expr =~ s/>=/ ge /; 463 $expr =~ s/</ lt /; 464 $expr =~ s/>/ gt /; 465 466 # Turn it into something that eval's to a number. Maybe not needed? O_o 467 #$expr = "( $expr ? 1 : 0 )"; 468 469 $expr = eval $expr; 470 } 471 446 472 next LINE if $expr != 0; # This appears to be the only case we call false. 447 473 while (<SPECFILE>) {
Note:
See TracChangeset
for help on using the changeset viewer.