home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _9ed8d3626038cb4958ccbd9a4f5c00de < prev    next >
Encoding:
Text File  |  2004-06-01  |  680 b   |  41 lines

  1. package PPM::Archive::Tar;
  2.  
  3. use strict;
  4. use Archive::Tar;
  5. use base qw(PPM::Archive);
  6.  
  7. sub is_gzipped {
  8.     my $o = shift;
  9.     return $o->{file} =~ /\.gz$/i
  10. }
  11.  
  12. #sub is_bzipped {
  13. #    my $o = shift;
  14. #    return $o->{file} =~ /\.bz(?:ip)?2$/;
  15. #}
  16.  
  17. sub load {
  18.     my $o = shift;
  19.     my $f = $o->{file};
  20. #    if ($o->is_bzipped) {
  21. #    require Compress::Bzip2;
  22. #    $o->{archive} = Archive::Tar::->new($f);
  23. #    }
  24. #   else {
  25.     $o->{archive} = Archive::Tar::->new($f, $o->is_gzipped);
  26. #   }
  27. }
  28.  
  29. sub list_files {
  30.     my $o = shift;
  31.     $o->{archive}->list_files;
  32. }
  33.  
  34. sub extract {
  35.     my $o = shift;
  36.     my $f = shift;
  37.     $o->{archive}->extract($f);
  38. }
  39.  
  40. 1;
  41.