Changeset 2082


Ignore:
Timestamp:
2001-02-28T15:59:12+13:00 (23 years ago)
Author:
jrm21
Message:

added bzip2 support (untested).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/ZIPPlug.pm

    r1812 r2082  
    3030# gzip (.gz, .z, .tgz, .taz)
    3131# bzip (.bz)
     32# bzip2 (.bz2)
    3233# zip (.zip .jar)
    3334# tar (.tar)
     
    3839# gunzip (for gzip)
    3940# bunzip (for bzip)
     41# bunzip2
    4042# unzip (for zip)
    4143# tar (for tar)
     
    8284    return undef if ($ENV{'GSDLOS'} =~ /^windows$/i);
    8385
    84     if ($file =~ /\.(gz|tgz|z|taz|bz|zip|jar|tar)$/i) {
     86    if ($file =~ /\.(gz|tgz|z|taz|bz|bz2|zip|jar|tar)$/i) {
    8587
    8688    my $filename = &util::filename_cat ($base_dir, $file);
     
    103105    if ($file =~ /\.bz$/i) {
    104106        $self->bunzip ($file_only);
     107    } elsif ($file =~ /\.bz2$/i) {
     108        $self->bunzip2 ($file_only);
    105109    } elsif ($file =~ /\.(zip|jar)$/i) {
    106110        $self->unzip ($file_only);
     
    126130    my ($file) = @_;
    127131    if (system ("bunzip $file")!=0)
     132    {
     133    &util::rm ($file);
     134    }
     135}
     136
     137sub bunzip2 {
     138    my $self = shift (@_);
     139    my ($file) = @_;
     140    if (system ("bunzip2 $file")!=0)
    128141    {
    129142    &util::rm ($file);
Note: See TracChangeset for help on using the changeset viewer.