Changeset 97 for trunk


Ignore:
Timestamp:
05/03/07 16:06:18 (18 years ago)
Author:
kdeugau
Message:

/trunk

Execute %clean script on build-all or build-binary (-ta, -tb, -ba, -bb)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r96 r97  
    248248  binpackage();
    249249  srcpackage();
     250  clean();
    250251}
    251252# -> binpkg if -.b
    252253if ($cmdopts{stage} eq 'b') {
    253254  binpackage();
     255  clean();
    254256}
    255257
     
    10671069  system "$paxcmd";
    10681070  $finalmessages .= "Wrote source package $pkgsrcname in $topdir/SDEBS.\n";
    1069 }
     1071} # end srcpackage()
     1072
     1073
     1074## clean()
     1075# Writes and executes the %clean script (mostly) built while reading the spec file.
     1076sub clean {
     1077  # Replace some things here just to make sure.
     1078  $cleanscript = expandmacros($cleanscript,'gp');
     1079
     1080  # create script filename
     1081  my $cleanscriptfile = "$tmpdir/deb-tmp.clean.".int(rand(99998)+1);
     1082  sysopen(CLEANSCRIPT, $cleanscriptfile, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW)
     1083        or die $!;
     1084  print CLEANSCRIPT $scriptletbase;
     1085  print CLEANSCRIPT $cleanscript;
     1086  close CLEANSCRIPT;
     1087
     1088  # execute
     1089  print "Calling \%clean script $cleanscriptfile...\n";
     1090  system("/bin/sh -e $cleanscriptfile") == 0
     1091        or die "Can't exec: $!\n";
     1092
     1093  # and clean up
     1094  unlink $cleanscriptfile;
     1095} # end clean()
    10701096
    10711097
Note: See TracChangeset for help on using the changeset viewer.