Index: branches/eam_branches/ipp-20110213/psconfig/pscheckmods
===================================================================
--- branches/eam_branches/ipp-20110213/psconfig/pscheckmods	(revision 30628)
+++ branches/eam_branches/ipp-20110213/psconfig/pscheckmods	(revision 30885)
@@ -1,14 +1,22 @@
 #!/usr/bin/env perl
 
+$VERBOSE = 0;
+if (@ARGV > 2 && $ARGV[0] eq "-v") {
+    $VERBOSE = 1;
+    shift @ARGV;
+}
 if (@ARGV != 2) { die "USAGE: pscheckmods (module) (version)\n"; }
 
-# print STDERR "checking in @INC\n";
+if ($VERBOSE) { print STDERR "checking in @INC\n"; }
+
+# &detailed_require ($ARGV[0]);
 
 $x = eval "require $ARGV[0]; 1";
 if (! $x) { 
-    # print "$ARGV[0]: missing\n";
-    exit 1;
+    if (! $VERBOSE) { exit 1; }
+    print "$ARGV[0]: missing\n";
+    &detailed_require ($ARGV[0]);
 }
-# print "x: $x\n";
+if ($VERBOSE) { print "x: $x\n"; }
 
 $version = eval "\$$ARGV[0]::VERSION";
@@ -21,2 +29,35 @@
 
 exit 0;
+
+sub detailed_require {
+    my ($filename) = @_;
+    $filename =~ s|::|/|g;
+    $filename = "$filename.pm";
+    print "$filename\n";
+    if (exists $INC{$filename}) {
+	return 1 if $INC{$filename};
+	die "Compilation failed in require";
+    }
+    my ($realfilename,$result);
+  ITER: {
+      foreach $prefix (@INC) {
+	  $realfilename = "$prefix/$filename";
+	  print "$realfilename\n";
+	  if (-f $realfilename) {
+	      $INC{$filename} = $realfilename;
+	      $result = do $realfilename;
+	      last ITER;
+	  }
+      }
+      die "Can't find $filename in \@INC";
+    }
+    if ($@) {
+	$INC{$filename} = undef;
+	die $@;
+    } elsif (!$result) {
+	delete $INC{$filename};
+	die "$filename did not return true value";
+    } else {
+	return $result;
+    }
+}
