From: Richard D. <rd...@us...> - 2002-08-21 07:21:46
|
Update of /cvsroot/twiki/twiki/bin In directory usw-pr-cvs1:/tmp/cvs-serv16234 Modified Files: testenv Log Message: Update to report on optional modules such as Algorithm::Diff, as discussed in Codev.CpanPerlModulesRequirement. Index: testenv =================================================================== RCS file: /cvsroot/twiki/twiki/bin/testenv,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** testenv 20 Aug 2002 07:34:43 -0000 1.25 --- testenv 21 Aug 2002 07:21:40 -0000 1.26 *************** *** 94,97 **** --- 94,101 ---- 'Net::SMTP', ); + my @optionalMods = ( + 'Algorithm::Diff', # For RcsLite + ); + open(STDERR,'>&STDOUT'); # redirect error to browser *************** *** 255,259 **** # Check that each of the required Perl modules can be loaded, and # print its version number. ! print "<tr><th align=\"right\">Perl modules:</th><td>"; foreach $mod (@requiredMods) { eval "use $mod"; --- 259,263 ---- # Check that each of the required Perl modules can be loaded, and # print its version number. ! print "<tr><th align=\"right\">Required Perl modules:</th><td>"; foreach $mod (@requiredMods) { eval "use $mod"; *************** *** 262,265 **** --- 266,287 ---- print "<b><font color=\"red\">Warning:</font></b> "; print "'$mod' not installed - check TWiki documentation to see if this is required.\n"; + print "</td></tr>\n"; + } else { + my $mod_version = $ {"$ {mod}::VERSION"}; + print "$mod ($mod_version)"; + print "</td></tr>\n"; + } + print "</td></tr>\n"; + } + + # Check that each of the optional Perl modules can be loaded, and + # print its version number. + print "<tr><th align=\"right\">Optional Perl modules:</th><td>"; + foreach $mod (@optionalMods) { + eval "use $mod"; + print "<tr><th></th><td>\n"; + if ($@) { + print "<b><font color=\"green\">Note:</font></b> "; + print "Optional module '$mod' not installed - check TWiki documentation to see if your configuration needs this module.\n"; print "</td></tr>\n"; } else { |