X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Ffind-use.pl;h=84129c29f3388e172d6087c0f8176b6f52ce7cdc;hb=6833aa9af01409d28ba7cf605357850f81b85682;hp=dbd30aa6079919ec09cd5ec610408a466b60bb0a;hpb=89c9ff022d3f13e27ba6bda085df15707fcfb0eb;p=kivitendo-erp.git diff --git a/scripts/find-use.pl b/scripts/find-use.pl old mode 100644 new mode 100755 index dbd30aa60..84129c29f --- a/scripts/find-use.pl +++ b/scripts/find-use.pl @@ -12,6 +12,10 @@ my (%uselines, %modules, %supplied, %requires); # easily obtained, I'll just hard code the bigger ones we use here. the same # hash will be filled later with information gathered from the source files. %requires = ( + 'DateTime' => { + 'DateTime::Duration' => 1, + 'DateTime::Infinite' => 1, + }, 'Rose::DB::Object' => { 'Rose::DB::Object::ConventionManager' => 1, 'Rose::DB::Object::Manager' => 1, @@ -46,7 +50,7 @@ find(sub { my ($useline) = m/^use\s+(.*?)$/; - next if $useline =~ /^[\d.]+;/; # skip version requirements + next if $useline =~ /^[\d._]+;/; # skip version requirements next if !$useline; $uselines{$useline} ||= []; @@ -75,10 +79,12 @@ for my $useline (keys %uselines) { next if $useline =~ /^most and offer that in a small/; # YAML my $version = Module::CoreList->first_release($module); - $modules{$module} = $supplied{$module} ? 'included' - : $version ? sprintf '%2.6f', $version - : is_documented($module) ? 'required' - : '!missing'; + $modules{$module} = { status => $supplied{$module} ? 'included' + : $version ? sprintf '%2.6f', $version + : is_documented($module) ? 'required' + : '!missing', + files => $uselines{$useline}, + }; # build requirement tree for my $file (@{ $uselines{$useline} }) { @@ -95,19 +101,21 @@ while ($changed) { $changed = 0; for my $src_module (keys %requires) { for my $dst_module (keys %{ $requires{$src_module} }) { - if ( $modules{$src_module} =~ /^required/ - && $modules{$dst_module} eq '!missing') { - $modules{$dst_module} = "required"; # . ", via $src_module"; + if ( $modules{$src_module} + && $modules{$dst_module} + && $modules{$src_module}->{status} =~ /^required/ + && $modules{$dst_module}->{status} eq '!missing') { + $modules{$dst_module}->{status} = "required"; # . ", via $src_module"; $changed = 1; } } } } -print sprintf "%8s : %s", color_text($modules{$_}), $_ +print sprintf "%8s : %s (%s)", color_text($modules{$_}->{status}), $_, join(' ', @{ $modules{$_}->{files} || [] }) for sort { - $modules{$a} cmp $modules{$b} - || $a cmp $b + $modules{$a}->{status} cmp $modules{$b}->{status} + || $a cmp $b } keys %modules; sub modulize { @@ -180,11 +188,13 @@ This module is included in C. Don't worry about it. This module is documented in C to be necessary, or is a dependancy of one of these. Everything alright. -= item !missing +=item !missing These modules are neither core, nor included, nor required. This is ok for developer tools, but should never occur for modules the actual program uses. +=back + =head1 AUTHOR http://www.ledgersmb.org/ - The LedgerSMB team