Index: /main/trunk/greenstone2/bin/script/plugoutinfo.pl
===================================================================
--- /main/trunk/greenstone2/bin/script/plugoutinfo.pl	(revision 32510)
+++ /main/trunk/greenstone2/bin/script/plugoutinfo.pl	(revision 32511)
@@ -177,5 +177,5 @@
 	    my $plugout;
 	    push @$plugout,$plugout_name; 
-	    my $plugoutobj = &plugout::load_plugout ($plugout);
+	    my $plugoutobj = &plugout::load_plugout ($plugout, "info_only");
 	    if ($describeall) {
 		$plugoutobj->print_xml_usage(0);
@@ -202,5 +202,5 @@
     push @$plugout,$plugout_name;
 
-    my $plugoutobj = &plugout::load_plugout($plugout);
+    my $plugoutobj = &plugout::load_plugout($plugout, "info_only");
 
     if ($xml) {
Index: /main/trunk/greenstone2/perllib/plugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugout.pm	(revision 32511)
@@ -48,5 +48,7 @@
 sub load_plugout{
     my ($plugout) = shift @_;
+    my ($info_only) = shift @_; # optional. Set to info_only if we're just printing out plugout info
     my $plugout_name = shift @$plugout;
+
     my $plugout_suffix = &FileUtils::filenameConcatenate('perllib', 'plugouts', $plugout_name . '.pm');
     my $plugout_found = 0;
@@ -148,4 +150,9 @@
     my ($plugobj);
 
+    # if just doing plugoutinfo.pl, add in -gsdlinfo to plugout object's options
+    if($info_only) {
+	unshift (@$plugout, "-gsdlinfo");
+    }
+    
     eval ("\$plugobj = new \$plugout_name([],\$plugout)");
     die "$@" if $@;
Index: /main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm	(revision 32511)
@@ -133,5 +133,6 @@
 
     # 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.
+    #print STDERR "#### " . join(",", @${args}) . "\n\n";
     foreach my $strArg (@{$args})
     {
Index: /main/trunk/greenstone2/perllib/plugouts/DSpacePlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/DSpacePlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/DSpacePlugout.pm	(revision 32511)
@@ -60,6 +60,10 @@
     push(@{$hashArgOptLists->{"OptList"}},$options);
 
-    my $self = new BasePlugout($plugoutlist,$inputargs,$hashArgOptLists);    
-
+    my $self = new BasePlugout($plugoutlist,$inputargs,$hashArgOptLists);
+    
+    if ($self->{'info_only'}) {	
+        # don't worry about any options etc
+        return bless $self, $class;
+    }
 #    print STDERR "***** metadata prefix = \"", $self->{'metadata_prefix'}, "\"\n";
 
Index: /main/trunk/greenstone2/perllib/plugouts/FedoraMETSPlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/FedoraMETSPlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/FedoraMETSPlugout.pm	(revision 32511)
@@ -37,15 +37,8 @@
     @FedoraMETSPlugout::ISA = ('METSPlugout');
 
-    if ((!defined $ENV{'FEDORA_HOME'}) || (!defined $ENV{'FEDORA_VERSION'})) {
-	if (defined $ENV{'FEDORA_HOME'}) {
-	    print STDERR "FEDORA_HOME = $ENV{'FEDORA_HOME'}";
-	}
-
-	if (defined $ENV{'FEDORA_VERSION'}) {
-	    print STDERR "FEDORA_VERSION = $ENV{'FEDORA_VERSION'}";
-	}
-
-	die "Need both environment variables FEDORA_HOME and FEDORA_VERSION to be set\n";
-    }
+    # Need both environment variables FEDORA_HOME and FEDORA_VERSION to be set to use this plugout!
+    # But we only test these vars are set in the constructor, so as not to break plugoutinfo.pl by
+    # a 'die' statement here nor break the xml that plugoutinfo.pl produces with print stmts here
+
 
     $ENV{'FEDORA_HOSTNAME'} = "localhost" if (!defined $ENV{'FEDORA_HOSTNAME'});
@@ -88,5 +81,24 @@
     
     my $self = new METSPlugout($plugoutlist,$inputargs,$hashArgOptLists);
-
+    
+    if ($self->{'info_only'}) {
+        # don't worry about any options etc
+        return bless $self, $class;
+    }
+    
+    # else (if we're not producing information for plugoutinfo.pl) make sure
+    # BOTH env vars FEDORA_HOME and FEDORA_VERSION are set. If either not set, die.
+    if ((!defined $ENV{'FEDORA_HOME'}) || (!defined $ENV{'FEDORA_VERSION'})) {
+	if (defined $ENV{'FEDORA_HOME'}) {
+	    print STDERR "FEDORA_HOME = $ENV{'FEDORA_HOME'}";
+	}
+	
+	if (defined $ENV{'FEDORA_VERSION'}) {
+	    print STDERR "FEDORA_VERSION = $ENV{'FEDORA_VERSION'}";
+	}
+	
+	die "ERROR: Need both environment variables FEDORA_HOME and FEDORA_VERSION to be set\n";
+    }
+    
     return bless $self, $class;
 }
Index: /main/trunk/greenstone2/perllib/plugouts/GreenstoneMETSPlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/GreenstoneMETSPlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/GreenstoneMETSPlugout.pm	(revision 32511)
@@ -57,4 +57,9 @@
 
     my $self = new METSPlugout($plugoutlist,$inputargs,$hashArgOptLists);
+    
+    if ($self->{'info_only'}) {	
+        # don't worry about any options etc
+        return bless $self, $class;
+    }
     
     return bless $self, $class;
Index: /main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm	(revision 32511)
@@ -63,5 +63,9 @@
 
     my $self = new BasePlugout($plugoutlist,$inputargs,$hashArgOptLists);
- 
+    
+    if ($self->{'info_only'}) {	
+        # don't worry about any options etc
+        return bless $self, $class;
+    }
     return bless $self, $class;
 }
Index: /main/trunk/greenstone2/perllib/plugouts/MARCXMLPlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/MARCXMLPlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/MARCXMLPlugout.pm	(revision 32511)
@@ -78,5 +78,10 @@
 
     my $self = new BasePlugout($plugoutlist,$inputargs,$hashArgOptLists);
-
+    
+    if ($self->{'info_only'}) {	
+        # don't worry about any options etc
+        return bless $self, $class;
+    }
+    
     $self->{'buffered_output'} ="";
      
Index: /main/trunk/greenstone2/perllib/plugouts/METSPlugout.pm
===================================================================
--- /main/trunk/greenstone2/perllib/plugouts/METSPlugout.pm	(revision 32510)
+++ /main/trunk/greenstone2/perllib/plugouts/METSPlugout.pm	(revision 32511)
@@ -71,5 +71,10 @@
 
     my $self = new BasePlugout($plugoutlist,$inputargs,$hashArgOptLists);
-
+    
+    if ($self->{'info_only'}) {
+        # don't worry about any options etc
+        return bless $self, $class;
+    }
+    
     if(defined $self->{'xslt_txt'} &&  $self->{'xslt_txt'} ne "")
     {
