Changeset 199


Ignore:
Timestamp:
08/03/15 17:31:13 (9 years ago)
Author:
kdeugau
Message:

/trunk

Fix and slightly extend SourceNN: archive format support again for rare
.tgz and .tar.Z.

Andreas Scherer suggested adding support for .zip, and provided a
preliminary patch (thanks!); comments on the patch noted .tgz was
probably broken (yep) and while I was looking at the set I noticed I had
made partial allowance for .tar.Z but had left that incomplete as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debbuild

    r198 r199  
    368368  $specfile = "$topdir/BUILD/". qx { zcat $tarball |tar -t |grep -e '[\.]spec\$' };
    369369  chomp $specfile;
    370   my ($fileonly, $dirname) = ($tarball =~ /(([a-zA-Z0-9._-]+)\.tar\.(?:gz|bz2|xz))$/);
     370  my ($fileonly, $dirname) = ($tarball =~ /(([a-zA-Z0-9._-]+)\.(?:tgz|tar\.(?:gz|bz2|xz|Z)))$/);
    371371
    372372  $tarball = abs_path($tarball);
    373373##fixme:  use macro expansions for the executables
    374374  my $unpackcmd = "cd $topdir/BUILD; ".
    375         ( $tarball =~ /\.tar\.gz$/       ? "/bin/gzip"   : "" ).
    376         ( $tarball =~ /\.tar\.bz2$/      ? "/bin/bzip2"  : "" ).
    377         ( $tarball =~ /\.tar\.(?:gz|Z)$/ ? "/usr/bin/xz" : "" ).
     375        ( $tarball =~ /\.(?:tgz|tar\.(?:gz|Z))$/         ? "/bin/gzip"   : "" ).
     376        ( $tarball =~ /\.tar\.bz2$/                     ? "/bin/bzip2"  : "" ).
     377        ( $tarball =~ /\.tar\.xz$/                      ? "/usr/bin/xz" : "" ).
    378378        " -dc $tarball |/bin/tar -xf -";
    379379
     
    933933          } else {
    934934            $prepscript .=
    935                 ( $pkgdata{main}{source} =~ /\.tar\.gz$/ ? "/bin/gzip"   : "" ).
    936                 ( $pkgdata{main}{source} =~ /\.tar\.bz2$/ ? "/bin/bzip2"  : "" ).
    937                 ( $pkgdata{main}{source} =~ /\.tar\.xz$/  ? "/usr/bin/xz" : "" ).
     935                ( $pkgdata{main}{source} =~ /\.(?:tgz|tar\.(?:gz|Z))$/  ? "/bin/gzip"   : "" ).
     936                ( $pkgdata{main}{source} =~ /\.tar\.bz2$/                ? "/bin/bzip2"  : "" ).
     937                ( $pkgdata{main}{source} =~ /\.tar\.xz$/                ? "/usr/bin/xz" : "" ).
    938938                " -dc '$topdir/SOURCES/$pkgdata{main}{source}' | /bin/tar -x".
    939939                ( $quietunpack ? '' : 'vv' )."f - ";
     
    952952            } else {
    953953              $prepscript .=
    954                 ( $pkgdata{sources}{$snum} =~ /\.tar\.gz$/ ? "/bin/gzip"   : "" ).
    955                 ( $pkgdata{sources}{$snum} =~ /\.tar\.bz2$/ ? "/bin/bzip2"  : "" ).
    956                 ( $pkgdata{sources}{$snum} =~ /\.tar\.xz$/  ? "/usr/bin/xz" : "" ).
     954                ( $pkgdata{sources}{$snum} =~ /\.(?:tgz|tar\.(?:gz|Z))$/ ? "/bin/gzip"   : "" ).
     955                ( $pkgdata{sources}{$snum} =~ /\.tar\.bz2$/              ? "/bin/bzip2"  : "" ).
     956                ( $pkgdata{sources}{$snum} =~ /\.tar\.xz$/              ? "/usr/bin/xz" : "" ).
    957957                " -dc '$topdir/SOURCES/$pkgdata{sources}{$snum}' | /bin/tar -x".
    958958                ( $quietunpack ? '' : 'vv' )."f -";
     
    969969            } else {
    970970              $prepscript .=
    971                 ( $pkgdata{sources}{$snum} =~ /\.tar\.gz$/  ? "/bin/gzip"   : "" ).
    972                 ( $pkgdata{sources}{$snum} =~ /\.tar\.bz2$/ ? "/bin/bzip2"  : "" ).
    973                 ( $pkgdata{sources}{$snum} =~ /\.tar\.xz$/  ? "/usr/bin/xz" : "" ).
     971                ( $pkgdata{sources}{$snum} =~ /\.(?:tgz|tar\.(?:gz|Z))$/  ? "/bin/gzip"   : "" ).
     972                ( $pkgdata{sources}{$snum} =~ /\.tar\.bz2$/              ? "/bin/bzip2"  : "" ).
     973                ( $pkgdata{sources}{$snum} =~ /\.tar\.xz$/                ? "/usr/bin/xz" : "" ).
    974974                " -dc '$topdir/SOURCES/$pkgdata{sources}{$snum}' | /bin/tar -x".
    975975                ( $quietunpack ? '' : 'vv' )."f -";
     
    11711171        $pkgdata{main}{source} =~ s|^.+/([^/]+)$|$1|;
    11721172        $pkgdata{sources}{0} = $pkgdata{main}{source};
    1173         # .tar, .tar.gz, .tar.bz2, .tgz, .xz, .zip
    1174         die "Unknown Source: header format $sval\n" if $sval !~ /\.(?:tar(?:\.(?:gz|bz2|xz))?|tgz|zip)$/;
     1173        # .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, .tgz, .zip
     1174        die "Unknown Source: header format $sval\n" if $sval !~ /\.(?:tar(?:\.(?:gz|bz2|xz|Z))?|tgz|zip)$/;
    11751175      } elsif (my ($srcnum, $src) = (/^source([0-9]+):\s*(.+)/i)) {
    11761176        $src =~ s/\s*$//;
     
    20972097 debbuild {-ba|-bb|-bp|-bc|-bi|-bl|-bs} [build-options] file.spec
    20982098
    2099  debbuild {-ta|-tb|-tp|-tc|-ti|-tl|-ts} [build-options] file.tar.{gz|bz2|xz}
     2099 debbuild {-ta|-tb|-tp|-tc|-ti|-tl|-ts} [build-options] file.{tgz|zip|tar.{gz|bz2|xz|Z}}
    21002100
    21012101 debbuild --rebuild file.{src.rpm|sdeb}
Note: See TracChangeset for help on using the changeset viewer.