Changeset 50


Ignore:
Timestamp:
03/07/06 17:56:45 (18 years ago)
Author:
kdeugau
Message:

/trunk

Add a few bits to mostly handle debbuild -i

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r49 r50  
    131131parse_cmd();
    132132
     133if ($cmdopts{install}) {
     134  install_sdeb();
     135  exit 0;
     136}
     137
     138# Stick --rebuild handling in here - basically install_sdeb()
     139# followed by tweaking options to run with -ba
     140
    133141if ($cmdopts{type} eq 'b') {
    134142  # Need to read the spec file to find the tarball.  Note that
     
    236244        } elsif (/^-v/) {
    237245          # bump verbosity.  Not sure what I'll actually do here...
     246        } elsif (/^-i/) {
     247          $cmdopts{install} = 1;
     248          $prevopt = '-i';
    238249        } else {
    239250          die "Bad option $_\n";
     
    249260      if ($prevopt eq '--buildroot') {
    250261        $cmdbuildroot = $_;
     262      } elsif ($prevopt eq '-i') {
     263        $srcpkg = $_;
    251264      } else {
    252265        if ($cmdopts{type} eq 's') {
    253266          # Source package
    254           if (!/\.src\.(deb|rpm)$/) {
     267          if (!/(sdeb|\.src\.rpm)$/) {
    255268            die "Can't --rebuild with $_\n";
    256269          }
     270          $srcpkg = $_;
    257271        } elsif ($cmdopts{type} eq 'b') {
    258272          $specfile = $_;
     
    971985
    972986
     987## install_sdeb()
     988# Extracts .sdeb contents to %_topdir as appropriate
     989sub install_sdeb {
     990  my $paxcmd = "cd $topdir; pax -r <$srcpkg; cd -";
     991
     992  # In case of %-macros...
     993  $paxcmd = expandmacros($paxcmd,'gp');
     994 
     995  system "$paxcmd";
     996  print "Extracted source package $srcpkg to $topdir.\n";
     997} # end install_sdeb()
     998
     999
    9731000## expandmacros()
    9741001# Expands all %{blah} macros in the passed string
Note: See TracChangeset for help on using the changeset viewer.