Changeset 116


Ignore:
Timestamp:
07/19/07 15:27:16 (17 years ago)
Author:
kdeugau
Message:

/trunk

Refix macro expansion fix from r114. Really.
(Make sure we recursively expand %specglobal macros - mostly from
%defines, re-complexify parts of the %if-construct expansion so
that it actually, um, expands.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r115 r116  
    14941494    $macrostring =~ s'%{_datadir}'/usr/share'g;
    14951495
    1496     # %define's
    1497     foreach my $key (keys %specglobals) {
    1498       $macrostring =~ s|%{$key}|$specglobals{$key}|g;
    1499     }
    1500 
    15011496    # special %define's.  Handle the general case where we eval anything.
    15021497    # Even more general:  %(...) is a spec-parse-time shell code wrapper.
     
    15151510    # there's no value specified...  but so does rpm.
    15161511my $tmpcount = 0;
    1517     while ($macrostring =~ /(\%\{(!\?|\?!|\?)([a-z0-9_.-]+)(?:\:([a-z0-9_.-]+))?\})/g) {       #Whew....
    1518       my $wholemacro = $1;      # Just for precision when replacing content in multimacro lines...
    1519       my $qex = $2;
    1520       my $macro = $3;
    1521       my $value = $4;
     1512    while ($macrostring =~ /\%\{(!\?|\?!|\?)([a-z0-9_.-]+)(?:\:([a-z0-9_.-]+))?\}/g) {       #Whew....
     1513      my $qex = $1;
     1514      my $macro = $2;
     1515      my $value = $3;
    15221516
    15231517      my $neg = '1' if $qex =~ /\!/;
     
    15271521        $value = '' if !$neg;
    15281522      }
    1529       $macrostring =~ s/$wholemacro/$value/;
     1523      $macrostring =~ s/\%\{!?\?\!?[a-z0-9_.-]+(?:\:[a-z0-9_.-]+)?\}/$value/;
    15301524
    15311525# not certain about this, but I don't want to run away.  It *can* happen if planned carefully.  :/
     
    15341528
    15351529    } # while()
     1530
     1531# should probably stick a "no runaway" flag in here...  Just In Case...
     1532    # %define's
     1533    while (my ($key) = ($macrostring =~ /%{([a-z0-9]+)}/i) ) {
     1534      $macrostring =~ s|%{$key}|$specglobals{$key}|g;
     1535                # wanna limit this to "... if $specglobals{$key}", but need more magic
     1536    }
    15361537
    15371538    # system programs.  RPM uses a global config file for these;  we'll just
Note: See TracChangeset for help on using the changeset viewer.