projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reste der Tabellen "rma" und "rmaitems" entfernt
[kivitendo-erp.git]
/
scripts
/
find-use.pl
diff --git
a/scripts/find-use.pl
b/scripts/find-use.pl
index
84129c2
..
959ecbe
100755
(executable)
--- a/
scripts/find-use.pl
+++ b/
scripts/find-use.pl
@@
-5,6
+5,7
@@
use File::Find;
use Module::CoreList;
use SL::InstallationCheck;
use Term::ANSIColor;
use Module::CoreList;
use SL::InstallationCheck;
use Term::ANSIColor;
+use Getopt::Long;
my (%uselines, %modules, %supplied, %requires);
my (%uselines, %modules, %supplied, %requires);
@@
-30,13
+31,28
@@
my (%uselines, %modules, %supplied, %requires);
'Template::Iterator' => 1,
'Template::Plugin' => 1,
'Template::Plugin::Filter' => 1,
'Template::Iterator' => 1,
'Template::Plugin' => 1,
'Template::Plugin::Filter' => 1,
+ 'Template::Plugin::HTML' => 1,
},
},
+ 'Devel::REPL' => {
+ 'namespace::clean' => 1,
+ },
+ 'Email::MIME' => {
+ 'Email::MIME::Creator' => 1,
+ },
+ 'Test::Harness' => {
+ 'TAP::Parser' => 1,
+ 'TAP::Parser::Aggregator' => 1,
+ },
+);
+
+GetOptions(
+ 'files-with-match|l' => \ my $l,
);
find(sub {
return unless /(\.p[lm]|console)$/;
);
find(sub {
return unless /(\.p[lm]|console)$/;
- # remember modules shipped with
Lx-Office
+ # remember modules shipped with
kivitendo
$supplied{modulize($File::Find::name)}++
if $File::Find::dir =~ m#modules/#;
$supplied{modulize($File::Find::name)}++
if $File::Find::dir =~ m#modules/#;
@@
-81,7
+97,9
@@
for my $useline (keys %uselines) {
my $version = Module::CoreList->first_release($module);
$modules{$module} = { status => $supplied{$module} ? 'included'
: $version ? sprintf '%2.6f', $version
my $version = Module::CoreList->first_release($module);
$modules{$module} = { status => $supplied{$module} ? 'included'
: $version ? sprintf '%2.6f', $version
- : is_documented($module) ? 'required'
+ : is_required($module) ? 'required'
+ : is_optional($module) ? 'optional'
+ : is_developer($module) ? 'developer'
: '!missing',
files => $uselines{$useline},
};
: '!missing',
files => $uselines{$useline},
};
@@
-95,6
+113,11
@@
for my $useline (keys %uselines) {
}
}
}
}
+# have all documented modules mentioned here
+$modules{$_->{name}} ||= { status => 'required' } for @SL::InstallationCheck::required_modules;
+$modules{$_->{name}} ||= { status => 'optional' } for @SL::InstallationCheck::optional_modules;
+$modules{$_->{name}} ||= { status => 'developer' } for @SL::InstallationCheck::developer_modules;
+
# build transitive closure for documented dependancies
my $changed = 1;
while ($changed) {
# build transitive closure for documented dependancies
my $changed = 1;
while ($changed) {
@@
-103,7
+126,7
@@
while ($changed) {
for my $dst_module (keys %{ $requires{$src_module} }) {
if ( $modules{$src_module}
&& $modules{$dst_module}
for my $dst_module (keys %{ $requires{$src_module} }) {
if ( $modules{$src_module}
&& $modules{$dst_module}
- && $modules{$src_module}->{status} =~ /^
required
/
+ && $modules{$src_module}->{status} =~ /^
(required|devel|optional)
/
&& $modules{$dst_module}->{status} eq '!missing') {
$modules{$dst_module}->{status} = "required"; # . ", via $src_module";
$changed = 1;
&& $modules{$dst_module}->{status} eq '!missing') {
$modules{$dst_module}->{status} = "required"; # . ", via $src_module";
$changed = 1;
@@
-112,8
+135,12
@@
while ($changed) {
}
}
}
}
-print sprintf "%8s : %s (%s)", color_text($modules{$_}->{status}), $_, join(' ', @{ $modules{$_}->{files} || [] })
- for sort {
+do {
+ print sprintf "%8s : %s", color_text($modules{$_}->{status}), $_;
+ if ($l) {
+ print " $_" for @{ $modules{$_}->{files} || [] };
+ }
+} for sort {
$modules{$a}->{status} cmp $modules{$b}->{status}
|| $a cmp $b
} keys %modules;
$modules{$a}->{status} cmp $modules{$b}->{status}
|| $a cmp $b
} keys %modules;
@@
-128,11
+155,21
@@
sub modulize {
}
}
}
}
-sub is_
document
ed {
+sub is_
requir
ed {
my ($module) = @_;
grep { $_->{name} eq $module } @SL::InstallationCheck::required_modules;
}
my ($module) = @_;
grep { $_->{name} eq $module } @SL::InstallationCheck::required_modules;
}
+sub is_optional {
+ my ($module) = @_;
+ grep { $_->{name} eq $module } @SL::InstallationCheck::optional_modules;
+}
+
+sub is_developer {
+ my ($module) = @_;
+ grep { $_->{name} eq $module } @SL::InstallationCheck::developer_modules;
+}
+
sub color_text {
my ($text) = @_;
return color(get_color($text)) . $text . color('reset');
sub color_text {
my ($text) = @_;
return color(get_color($text)) . $text . color('reset');
@@
-205,5
+242,3
@@
Sven Schöling E<lt>s.schoeling@linet-services.deE<gt>
Distributed under the terms of the GNU General Public License v2.
=cut
Distributed under the terms of the GNU General Public License v2.
=cut
-
-