Skip to content

Commit

Permalink
Item12952: Clean up dependency report
Browse files Browse the repository at this point in the history
Add documentation for the new macro, and a dependency report for the
installation.

Also remove a perl 5.6 dependency from core.
  • Loading branch information
gac410 committed Sep 13, 2014
1 parent baeeb3a commit 09d7621
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 18 deletions.
17 changes: 14 additions & 3 deletions ConfigurePlugin/data/System/ConfigurePlugin.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1410628915" format="1.1" version="1"}%
%META:TOPICPARENT{name="Plugins"}%
<!--
One line description, required for extensions repository catalog.
Expand All @@ -7,20 +8,26 @@ One line description, required for extensions repository catalog.

%SHORTDESCRIPTION%

This plugin provides access to all Foswiki configuration data through
This plugin provides access to all %WIKITOOLNAME% configuration data through
the webserver, supports running server-side checkers and wizards, and
allows you to save modifications.

You do not have to have this plugin installed to run Foswiki. Checkers
You do not have to have this plugin installed to run %WIKITOOLNAME%. Checkers
and wizards can be run from the command-line using the =tools/configure_test=
script, and !LocalSite.cfg can be manually edited to add your required settings.
However this UI provides a simple way to access the configuration.

If your system has an existing !LocalSite.cfg, then you *must* be
logged in to Foswiki as an administrator before attempting to use
logged in to %WIKITOOLNAME% as an administrator, or as a user identified by the
={ConfigureFilter}= parameger before attempting to use
this interface. If no !LocalSite.cfg exists, then you will automatically
treated as an admin for the purposes of =configure=.

<div class="foswikiAlert">%X% Caution: The first save of the configuration
will reset admin status and block further access to configure. Be sure that
you set the ={ConfigureFilter}= parameter or have added a registered user to
the %USERSWEB%.AdminGroup before your first save of the configuration!</div>

Users of the =configure= interface access it through the CGI script in
=bin/configure=. The UI is self-explanatory and needs no further introduction
here.
Expand All @@ -29,6 +36,10 @@ Of interest to developers may be the JSON RPC interface provided by the
plugin, which gives access to the Foswiki configuration to web clients
(who must, of course, be authenticated as admins to make RPC calls).

This plugin also provides a DependencyReport. The DependencyReport analyzes the
identified perl dependencies for %WIKITOOLNAME% and all installed extensions, and
reports any issues with installed versions of the dependencies.

%$POD%

---++ Installation
Expand Down
22 changes: 22 additions & 0 deletions ConfigurePlugin/data/System/DependencyReport.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1410496197" format="1.1" reprev="1" version="1"}%
%META:TOPICPARENT{name="ConfigurePlugin"}%

---+!! Foswiki and Extensision perl dependencies

This topic reports the perl module dependencies. The module name links to the
module information on [[https://metacpan.org][meta::cpan]] In the extensions report, all users of the module are identified including the "%WIKITOOLNAME%" core. If a minimum version is identified, the extension requiring the highest
minimum version is underlined.

%TOC%

<noautolink>
---++ Foswiki dependencies

%DEPENDENCYREPORT%

---++ Foswiki extension dependencies


%DEPENDENCYREPORT{'extensions'}%
</noautolink>

10 changes: 10 additions & 0 deletions ConfigurePlugin/data/System/VarDEPENDENCYREPORT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%META:TOPICINFO{author="ProjectContributor" date="1410625418" format="1.1" version="1"}%
%META:TOPICPARENT{name="ConfigurePlugin"}%
#VarDEPENDENCYREPORT
---+++ DEPENDENCYREPORT -- report the perl module dependencies and status for Foswiki core
* Syntax: =%<nop>DEPENDENCYREPORT%=
---+++ DEPENDENCYREPORT{"extensions"} -- report the perl module dependencies for the installed extensions
* Syntax: =%<nop>DEPENDENCYREPORT{"extensions"}%=
* Supported parameters:
| *Parameter:* | *Description:* | *Default:* |
| ="extensions"= | The word ="extensions" - requests dependencies of installed extensions. | (not set) |
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sub analyzeExtensions {

foreach my $info ( values %seen ) {
if ( $info->{usage} ) {
$info->{usage} =~ s,^<br />,<br /><strong>Foswiki: </strong>,;
$info->{usage} =~ s,^\s?<br />,<br /><strong>Foswiki: </strong>,;
}
}
my %extns = (
Expand Down Expand Up @@ -119,10 +119,10 @@ sub _showDEPENDENCIES {
my $mvu = $_->[0]{minVersionUser};
$mvu = 'Foswiki' if ( $mvu eq 'core' );
my $mu = @{ $_->[0]{users} } > 1;
$_->[0]{usage} .= '<br><b>Used by: </b>'
$_->[0]{usage} .= ' <br><b>Used by:</b> '
. join( ', ',
map { $_ eq $mvu && $mu ? "<u>$_</u>" : $_ }
sort map { $_ eq 'core' ? 'Foswiki' : $_ }
map { $_ eq $mvu && $mu ? "<u>[[$_]]</u>" : "[[$_]]" }
sort map { $_ eq 'core' ? '%WIKITOOLNAME%' : $_ }
@{ $_->[0]{users} } )
if ($users);
$_->[0]
Expand All @@ -142,21 +142,26 @@ sub _showDEPENDENCIES {
: [ $_, [ split( /::/, $_->{name} ) ] ]
} @$perlModules;

Foswiki::Configure::Dependency::checkPerlModules( @list );
Foswiki::Configure::Dependency::checkPerlModules(@list);

foreach ( @list ) {
$_->{check_result} =~ s/(?>\x0D\x0A?|[\x0A-\x0C\x85\x{2028}\x{2029}])//sg;
my $ok = ( $_->{ok} ) ? '' : '<span class="foswikiAlert">%X% Possible missing dependency!</span><br/>';
$set .= "| CPAN:$_->{name} | $ok$_->{check_result} |\n";
foreach (@list) {

#SMELL: Something is inserting newlines, breaking the table. This fixes it.
$_->{check_result} =~
s/(?>\x0D\x0A?|[\x0A-\x0C\x85\x{2028}\x{2029}])//sg;
my $ok =
( $_->{ok} )
? ''
: '<span class="foswikiAlert">%X% Possible missing dependency!</span><br/>';
$set .= "| CPAN:$_->{name} | $ok$_->{check_result} |\n";
}
}
else {
$set = $perlModules;
}

$who = 'Foswiki' if ( $who eq 'core' );
return
"Perl modules used by $who \n" . $set;
return "Perl modules used by $who \n" . $set;
}

# Extract a list of the perl modules that are required by a DEPENDENCIES file.
Expand Down Expand Up @@ -218,12 +223,12 @@ s,\[\[(https?://[^\]]+)\]\[([^\]]+)\](?:\[[^\]]*\])?\],$dlink"$1">$2</a>,gms;
$info->{minimumVersion} = $ver;
$info->{minVersionUser} = $who;
}
$info->{usage} .= "<br />$dwho: $usage" if ($usage);
$info->{usage} .= " <br />$dwho: $usage" if ($usage);
next;
}
if ($usage) {
if ( $who eq 'core' ) {
$usage = "<br />" . ucfirst( lc($dispo) ) . " $usage";
$usage = " <br />" . ucfirst( lc($dispo) ) . " $usage";
}
else {
$usage = "<br />$dwho: " . ucfirst( lc($dispo) ) . " $usage";
Expand Down Expand Up @@ -255,7 +260,7 @@ Copyright (C) 2008-2014 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
Additional copyrights apply to some or all of the code in this
edditional copyrights apply to some or all of the code in this
file as follows:
Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
Expand Down
3 changes: 3 additions & 0 deletions ConfigurePlugin/lib/Foswiki/Plugins/ConfigurePlugin/MANIFEST
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
!noci
bin/configure
data/System/ConfigurePlugin.txt 0644 Documentation page
data/System/DependencyReport.txt 0644 System dependency report
data/System/VarDEPENDENCYREPORT.txt 0644 Documentation page
lib/Foswiki/Plugins/ConfigurePlugin.pm 0444 Perl module
lib/Foswiki/Plugins/ConfigurePlugin/Config.spec 0444 Configuration
lib/Foswiki/Plugins/ConfigurePlugin/JQuery.pm 0444 Configuration
lib/Foswiki/Plugins/ConfigurePlugin/DependencyReport.pm 0444 Configuration
pub/System/ConfigurePlugin/checkWhirly.gif 0444
pub/System/ConfigurePlugin/configure.css 0444
pub/System/ConfigurePlugin/configure.js 0444
Expand Down
1 change: 0 additions & 1 deletion core/lib/Foswiki/Contrib/core/DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ POSIX,>=1,cpan,Required, for base Foswiki
Socket,>=2.001,cpan,Required, for base Foswiki
Symbol,>=0,cpan,Optional, may be required for international characters
UNIVERSAL,>=0,cpan,Required,Basic perl module
Unicode::MapUTF8,>=0,cpan,Optional, This is required for international characters for Perl 5.6. Do not install this for Perl 5.8 or later.
version,>=0.77,cpan,Required, Used for standard perl version strings
Win32::Console,>=0,cpan,Optional, may be required for international characters on Windows

0 comments on commit 09d7621

Please sign in to comment.