Changeset 65 for trunk


Ignore:
Timestamp:
06/06/06 17:46:56 (19 years ago)
Author:
kdeugau
Message:

/trunk

Fixed the bug from the bugfix of the bug.... in Depends processing
Added basic -t support; functional but probably has a few bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r64 r65  
    181181}
    182182
     183if ($cmdopts{type} eq 't') {
     184  # Need to unpack the tarball to find the spec file.  Sort of the inverse of -b above.
     185  # zcat $tarball |tar -t |grep .spec
     186  # collect some info about the tarball
     187  $specfile = "$topdir/BUILD/". qx { zcat $tarball |tar -t |grep .spec\$ };
     188  chomp $specfile;
     189  my ($fileonly, $dirname) = ($tarball =~ /(([a-zA-Z0-9._-]+)\.tar\.(?:gz|bz2))$/);
     190
     191  $tarball = abs_path($tarball);
     192  my $unpackcmd = "cd $topdir/BUILD; tar -".
     193        ( $tarball =~ /\.tar\.gz$/ ? "z" : "" ).
     194        ( $tarball =~ /\.tar\.bz2$/ ? "j" : "" ). "xf $tarball";
     195  system "$unpackcmd";
     196  system "cp $tarball $topdir/SOURCES/$fileonly";
     197  system "cp $specfile $topdir/SPECS/";
     198  parse_spec();
     199  die "Can't build $pkgdata{main}{name}:  build requirements not met.\n"
     200    if !checkbuildreq();
     201}
     202
    183203# -> srcpkg if -.s
    184204if ($cmdopts{stage} eq 's') {
     
    304324          $srcpkg = $_;
    305325        } elsif ($cmdopts{type} eq 'b') {
     326          # Spec file
    306327          $specfile = $_;
    307           # Spec file
    308328        } else {
    309           # Tarball
     329          # Tarball build.  Need to extract tarball to find spec file.  Whee.
     330          $tarball = $_;
    310331        }
    311332      }
     
    362383# Parse the .spec file.
    363384sub parse_spec {
    364   open SPECFILE,"<$specfile";
     385  open SPECFILE,"<$specfile" or die "specfile ($specfile) barfed: $!";
    365386
    366387LINE: while (<SPECFILE>) {
     
    749770    # magic needed to properly version dependencies...
    750771    # only provided deps will really be included
     772    $pkgdata{$pkg}{requires} =~ s/^, //;        # Still have to do this here.
    751773    $pkgdata{$pkg}{requires} =~ s/\s+//g;
    752774    my @deps = split /,/, $pkgdata{$pkg}{requires};
Note: See TracChangeset for help on using the changeset viewer.