Changeset 32539 for main/trunk/greenstone2
- Timestamp:
- 2018-10-25T18:12:59+13:00 (5 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/basebuilder.pm
r31409 r32539 214 214 push @global_opts, "-separate_cjk"; 215 215 } 216 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $self->{'verbosity'}, $outhandle, $failhandle, \@global_opts, $self->{'incremental_mode'}, $gs_version );216 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $self->{'verbosity'}, $outhandle, $failhandle, \@global_opts, $self->{'incremental_mode'}, $gs_version, $self->{'site'}); 217 217 218 218 if (scalar(@{$self->{'pluginfo'}}) == 0) { -
main/trunk/greenstone2/perllib/inexport.pm
r32525 r32539 583 583 my @global_opts = (); 584 584 585 my $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $plugin_incr_mode, $gs_version );585 my $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $plugin_incr_mode, $gs_version, $self->{'site'}); 586 586 if (scalar(@$pluginfo) == 0) { 587 587 &gsprintf($out, "{import.no_plugins_loaded}\n"); -
main/trunk/greenstone2/perllib/plugin.pm
r30597 r32539 179 179 sub load_plugins { 180 180 my ($plugin_list) = shift @_; 181 my ($incremental_mode, $gs_version );182 ($verbosity, $outhandle, $failhandle, $globaloptions, $incremental_mode, $gs_version ) = @_; # globals181 my ($incremental_mode, $gs_version, $site); 182 ($verbosity, $outhandle, $failhandle, $globaloptions, $incremental_mode, $gs_version, $site) = @_; # globals 183 183 my @plugin_objects = (); 184 184 $verbosity = 2 unless defined $verbosity; … … 204 204 # put quotes around each option to the plugin, unless the option is already quoted 205 205 map { $_ = "\"$_\"" unless ($_ =~ m/^\s*\".*\"\s*$/) ; } @$pluginoptions; 206 my $options = "-gs_version,$gs_version,".join (",", @$pluginoptions); 206 my $site_option = $site ? "\"-site_name\",\"$site\"," : ""; 207 my $options = "$site_option"."-gs_version,$gs_version,".join (",", @$pluginoptions); 207 208 if ($globals) { 208 209 if (@$pluginoptions) { -
main/trunk/greenstone2/perllib/plugins/PrintInfo.pm
r32281 r32539 50 50 { 'name' => "gs_version", 51 51 'desc' => "{PrintInfo.gs_version}", 52 'type' => "string", 53 'reqd' => "no", 54 'hiddengli' => "yes" }, 55 { 'name' => "site_name", 56 'desc' => "{PrintInfo.site_name}", 52 57 'type' => "string", 53 58 'reqd' => "no", … … 81 86 # the args, just return the object. 82 87 # gsdlinfo must come before gs_version. both are set by plugin.pm 88 # The optional -site_name <site> (present only for GS3 and when not doing gsdlinfo), 89 # if it is there, also appears before gs_version and is also set by plugin.pm 83 90 my $v=0; 84 91 foreach my $strArg (@{$args}) 85 92 { 86 if ($v) { 93 if($v eq "-site_name") { 94 $self->{'site_name'} = $strArg; 95 } 96 elsif($v eq "-gs_version") { 87 97 $self->{'gs_version'} = $strArg; 88 98 last; … … 93 103 #return bless $self, $class; 94 104 } 95 elsif ($strArg eq "-gs_version" ) {96 $v = 1;105 elsif ($strArg eq "-gs_version" || $strArg eq "-site_name") { 106 $v = $strArg; 97 107 } 98 108 }
Note:
See TracChangeset
for help on using the changeset viewer.