Changeset 62 for trunk


Ignore:
Timestamp:
06/05/06 17:32:52 (18 years ago)
Author:
kdeugau
Message:

/trunk

*Sigh* Gotta remember to expand %define macros anywhere and everywhere.
(Perhaps expand macros before processing a line further?)

  • Requires, %description, %files, and %package are now suitably expanded
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r61 r62  
    375375      }
    376376
    377       if (/^\%description(?:\s+(?:-n\s+)?([a-zA-Z0-9_.-]+))?/) {
     377      if (/^\%description(?:\s+(?:-n\s+)?(.+))?/) {
    378378        my $subname = "main";
    379379        if ($1) {
    380           my $tmp = $1;
     380          my $tmp = expandmacros("$1", 'g');
    381381          if (/-n/) { $subname = $tmp; } else { $subname = "$pkgdata{main}{name}-$tmp"; }
    382382        }
     
    387387        }
    388388      }
    389       if (/^\%package\s+(?:-n\s+)?([a-zA-Z0-9_.-]+)/) {
    390         my $subname = $1;
     389      if (/^\%package\s+(?:-n\s+)?(.+)/) {
     390        # gotta expand %defines here.  Whee.
     391        my $subname = expandmacros("$1", 'g');
    391392        if (! /-n/) { $subname = "$pkgdata{main}{name}-$1"; }
    392393        push @pkglist, $subname;
     
    397398          if (my ($dname,$dvalue) = (/^(Summary|Group|Version|Requires|Provides):\s+(.+)$/i)) {
    398399            $dname =~ tr/[A-Z]/[a-z]/;
    399             $pkgdata{$subname}{$dname} = $dvalue;
     400            $pkgdata{$subname}{$dname} = expandmacros($dvalue, 'g');
    400401          }
    401402        }
     
    505506    # done %pre/%post scripts
    506507
    507       if (/^\%files(?:\s+(?:-n\s+)?([a-zA-z0-9.-]+))?/) {
     508      if (/^\%files(?:\s+(?:-n\s+)?(.+))?/) {
    508509        my $pkgname = 'main';
    509510        if ($1) {       # Magic to add entries to the right list of files
    510           my $tmp = $1;
     511          my $tmp = expandmacros("$1", 'g');
    511512          if (/-n/) { $pkgname = $tmp; } else { $pkgname = "$pkgdata{main}{name}-$tmp"; }
    512513        }
     
    606607        $buildreq .= ", $1";
    607608      } elsif (/^requires:\s+(.+)/i) {
    608         $pkgdata{main}{requires} .= ", $1";
     609        $pkgdata{main}{requires} .= ", ".expandmacros("$1", 'g');
    609610      } elsif (/^provides:\s+(.+)/i) {
    610611        $pkgdata{main}{provides} .= ", $1";
Note: See TracChangeset for help on using the changeset viewer.