Changeset 9229
- Timestamp:
- 2005-03-01T15:22:06+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ZIPPlug.pm
r6408 r9229 57 57 } 58 58 59 my $arguments = 60 [ { 'name' => "process_exp", 61 'desc' => "{BasPlug.process_exp}", 62 'type' => "string", 63 'deft' => &get_default_process_exp(), 64 'reqd' => "no" } ]; 65 59 66 my $options = { 'name' => "ZIPPlug", 60 67 'desc' => "{ZIPPlug.desc}", 61 68 'abstract' => "no", 62 'inherits' => "yes" }; 69 'inherits' => "yes", 70 'args' => $arguments }; 63 71 64 72 sub new { 65 73 my ($class) = @_; 66 74 my $self = new BasPlug ("ZIPPlug", @_); 75 $self->{'plugin_type'} = "ZIPPlug"; 67 76 68 77 # 14-05-02 To allow for proper inheritance of arguments - John Thompson … … 70 79 push( @{$option_list}, $options ); 71 80 81 if (!parsargv::parse(\@_, 82 q^process_exp/.*/^, \$self->{'process_exp'}, 83 "allow_extra_options")) { 84 print STDERR "\nIncorrect options passed to ZIPPlug, check your collect.cfg configuration file\n"; 85 $self->print_txt_usage(""); # Use default resource bundle 86 die "\n"; 87 } 88 89 # BasPlug is explicitly set not to set process_exp if recursive plugin 90 # Not sure of this reasoning. Want it to be set in ZIPPlug, so explicitly 91 # pass it in as default value 92 if (!$self->{'process_exp'}) { 93 $self->{'process_exp'} = get_default_process_exp(); 94 } 95 72 96 return bless $self, $class; 73 97 } … … 78 102 79 103 return 1; 104 } 105 106 sub get_default_process_exp { 107 return q^(?i)\.(gz|tgz|z|taz|bz|bz2|zip|jar|tar)$^; 80 108 } 81 109 … … 88 116 my $outhandle = $self->{'outhandle'}; 89 117 90 if ($file =~ / \.(gz|tgz|z|taz|bz|bz2|zip|jar|tar)$/i) {118 if ($file =~ /$self->{'process_exp'}/) { 91 119 92 120 my $filename = $file;
Note:
See TracChangeset
for help on using the changeset viewer.