Index: /main/trunk/greenstone2/bin/script/pluginfo.pl
===================================================================
--- /main/trunk/greenstone2/bin/script/pluginfo.pl	(revision 25956)
+++ /main/trunk/greenstone2/bin/script/pluginfo.pl	(revision 25957)
@@ -77,4 +77,9 @@
 	'type' => "string",
 	'reqd' => "no" },
+      { 'name' => "gs_version",
+	'desc' => "{pluginfo.gs_version}",
+	'type' => "string",
+	'reqd' => "no",
+	'hiddengli' => "yes" },
       { 'name' => "xml",
 	'desc' => "{scripts.xml}",
@@ -107,4 +112,5 @@
     my $site = "";
     my $collection = "";
+    my $gs_version = "";
     my $xml = 0;
     my $listall = 0;
@@ -121,5 +127,4 @@
  	die "\n";
     }
-    
     foreach my $strVariable (keys %$hashParsingResult)
     {
@@ -188,4 +193,5 @@
     if ($site ne "") {
 	# assume Greenstone 3
+	$gs_version = "3" if $gs_version eq "";
 	if ($collection ne "") {
 	    $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect", $collection);
@@ -196,4 +202,5 @@
     }
     else {
+	$gs_version = "2" if $gs_version eq "";
 	if ($collection ne "") {
 	    $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection);
@@ -247,5 +254,5 @@
 	foreach my $plugin (@plugin_list) {
 	    $plugin =~ s/\.pm$//;
-	    my $plugobj = &plugin::load_plugin_for_info ($plugin);
+	    my $plugobj = &plugin::load_plugin_for_info ($plugin, $gs_version);
 	    push (@plugobj_list, $plugobj);
 	}
@@ -267,5 +274,5 @@
     }
     else {
-	&print_single_plugin($plugin, $xml, 1);
+	&print_single_plugin($plugin, $gs_version, $xml, 1);
     }
 }
@@ -273,6 +280,6 @@
 
 sub print_single_plugin {
-    my ($plugin, $xml, $header) = @_;
-    my $plugobj = &plugin::load_plugin_for_info ($plugin);
+    my ($plugin, $gs_version, $xml, $header) = @_;
+    my $plugobj = &plugin::load_plugin_for_info ($plugin, $gs_version);
     if ($xml) {
 	&gsprintf::set_print_xml_tags();
Index: /main/trunk/greenstone2/perllib/inexport.pm
===================================================================
--- /main/trunk/greenstone2/perllib/inexport.pm	(revision 25956)
+++ /main/trunk/greenstone2/perllib/inexport.pm	(revision 25957)
@@ -173,4 +173,10 @@
     }
 
+    # set gs_verison 2/3
+    $self->{'gs_version'} = "2";
+    if ((defined $site) && ($site ne "")) {
+	# gs3
+	$self->{'gs_version'} = "3";
+    }
     # add collection's perllib dir  into include path in 
     # case we have collection specific modules
@@ -364,4 +370,6 @@
     my $incremental_mode = $self->{'incremental_mode'};
 
+    my $gs_version = $self->{'gs_version'};
+
     my $removeold   = $self->{'removeold'};
     my $keepold     = $self->{'keepold'};
@@ -433,5 +441,5 @@
     my @global_opts = ();
 
-    my $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $plugin_incr_mode);
+    my $pluginfo = &plugin::load_plugins ($plugins, $verbosity, $out, $faillog, \@global_opts, $plugin_incr_mode, $gs_version);
     if (scalar(@$pluginfo) == 0) {
 	&gsprintf($out, "{import.no_plugins_loaded}\n");
Index: /main/trunk/greenstone2/perllib/plugin.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugin.pm	(revision 25956)
+++ /main/trunk/greenstone2/perllib/plugin.pm	(revision 25957)
@@ -143,5 +143,5 @@
 
 sub load_plugin_for_info {
-    my ($pluginname) = shift @_;
+    my ($pluginname, $gs_version) = (@_);
     $pluginname = &get_valid_pluginname($pluginname);
     load_plugin_require($pluginname);
@@ -149,5 +149,5 @@
     # create a plugin object
     my ($plugobj);
-    my $options = "-gsdlinfo";
+    my $options = "-gsdlinfo,-gs_version,$gs_version";
     
     eval ("\$plugobj = new \$pluginname([],[$options])");
@@ -159,6 +159,6 @@
 sub load_plugins {
     my ($plugin_list) = shift @_;
-    my $incremental_mode;
-    ($verbosity, $outhandle, $failhandle, $globaloptions, $incremental_mode) = @_; # globals
+    my ($incremental_mode, $gs_version);
+    ($verbosity, $outhandle, $failhandle, $globaloptions, $incremental_mode, $gs_version) = @_; # globals
     my @plugin_objects = ();
     $verbosity = 2 unless defined $verbosity;
@@ -182,5 +182,5 @@
 	# put quotes around each option to the plugin, unless the option is already quoted
 	map { $_ = "\"$_\"" unless ($_ =~ m/^\s*\".*\"\s*$/) ; } @$pluginoptions;
-	my $options = join (",", @$pluginoptions);
+	my $options = "-gs_version,$gs_version,".join (",", @$pluginoptions);
 	if ($globals) {
 	    if (@$pluginoptions) {
Index: /main/trunk/greenstone2/perllib/plugins/PrintInfo.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugins/PrintInfo.pm	(revision 25956)
+++ /main/trunk/greenstone2/perllib/plugins/PrintInfo.pm	(revision 25957)
@@ -47,5 +47,12 @@
 use printusage;
 
-my $arguments = [];
+my $arguments = [
+    { 'name' => "gs_version",
+      'desc' => "{PrintInfo.gs_version}",
+      'type' => "string",
+      'reqd' => "no",
+      'hiddengli' => "yes" }
+
+];
 
 my $options = { 'name'     => "PrintInfo",
@@ -62,26 +69,44 @@
     my $plugin_name = (defined $pluginlist->[0]) ? $pluginlist->[0] : $class;
 
-    if ($plugin_name eq $class) {
+   if ($plugin_name eq $class) {
 	push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
 	push(@{$hashArgOptLists->{"OptList"}},$options);
-    }
+   }
     my $self = {};
     $self->{'outhandle'} = STDERR;
     $self->{'option_list'} = $hashArgOptLists->{"OptList"};
     $self->{"info_only"} = 0;
-
+    $self->{'gs_version'} = "2";
     # Check if gsdlinfo is in the argument list or not - if it is, don't parse 
-    # the args, just return the object.  
+    # the args, just return the object. 
+    # gsdlinfo must come before gs_version. both are set by plugin.pm
+    my $v=0;
     foreach my $strArg (@{$args})
     {
-	if($strArg eq "-gsdlinfo")
+	if ($v) {
+	    $self->{'gs_version'} = $strArg;
+	    last;
+	}
+ 	elsif($strArg eq "-gsdlinfo")
 	{
 	    $self->{"info_only"} = 1;
-	    return bless $self, $class;
-	}
-    }
-    
+	    #return bless $self, $class;
+	}
+	elsif ($strArg eq "-gs_version") {
+	    $v = 1;	    
+	}
+    }
+
+    if ($self->{"info_only"}) {
+	return bless $self, $class;
+    }
     if (defined $auxiliary) { # don't parse the args here
 	return bless $self, $class;
+    }
+
+    # now that we are passed printing out info, we do need to add in this class's options so that they are available for parsing. 
+    if ($plugin_name ne $class) {
+	push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
+	push(@{$hashArgOptLists->{"OptList"}},$options);
     }
 
