Changeset 11


Ignore:
Timestamp:
11/04/05 14:21:55 (19 years ago)
Author:
kdeugau
Message:

/trunk

Checkpoint
made expandmacros() more flexible; can now replace macros from
any section instead of just one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r10 r11  
    339339BUILDSCRIPT: while (<SPECFILE>) {
    340340          if (/^\%configure/) {
    341             my $tmp = expandmacros($_,'configure');
     341            my $tmp = expandmacros($_,'cg');
    342342            $buildscript .= $tmp;
    343343          } else {
     
    414414
    415415  # Expand macros as necessary.
    416   $scriptletbase = expandmacros($scriptletbase,'globals');
     416  $scriptletbase = expandmacros($scriptletbase,'g');
    417417
    418418  $buildroot = $cmdbuildroot if $cmdbuildroot;
    419   $buildroot = expandmacros($buildroot,'pkgdata');
     419  $buildroot = expandmacros($buildroot,'pg');
    420420
    421421} # end parse_spec()
     
    458458  print BUILDSCRIPT $scriptletbase;
    459459
    460   $buildscript = expandmacros($buildscript,'configure');
     460  $buildscript = expandmacros($buildscript,'cg');
    461461  print BUILDSCRIPT $buildscript;
    462462  close BUILDSCRIPT;
     
    568568  my $section = shift;  # We'll want to split things up a bit eventually.
    569569
    570   if ($section eq 'configure') {
     570  if ($section =~ /c/) {
    571571    # %configure-ish macros
    572572    # Note that these are processed in reverse order to get the substitution order right
     
    613613  } # done with config section
    614614
    615   if ($section eq 'globals') {
     615  if ($section =~ /g/) {
    616616    $macrostring =~ s/\%\{_topdir\}/$topdir/g;
    617617
     
    625625  } # done with globals section
    626626
    627   if ($section eq 'pkgdata') {
     627  if ($section =~ /p/) {
    628628    $macrostring =~ s/\%\{name\}/$pkgdata{main}{name}/g;
    629629    $macrostring =~ s/\%\{version\}/$pkgdata{main}{version}/g;
Note: See TracChangeset for help on using the changeset viewer.