Revision a31d5a20
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
- ID a31d5a2025cc21f0b7d49966eb7e1b4d2ade00c5
- Nachfolger 559eae20
scripts/find-use.pl | ||
---|---|---|
79 | 79 |
next if $useline =~ /^most and offer that in a small/; # YAML |
80 | 80 |
|
81 | 81 |
my $version = Module::CoreList->first_release($module); |
82 |
$modules{$module} = $supplied{$module} ? 'included' |
|
83 |
: $version ? sprintf '%2.6f', $version |
|
84 |
: is_documented($module) ? 'required' |
|
85 |
: '!missing'; |
|
82 |
$modules{$module} = { status => $supplied{$module} ? 'included' |
|
83 |
: $version ? sprintf '%2.6f', $version |
|
84 |
: is_documented($module) ? 'required' |
|
85 |
: '!missing', |
|
86 |
files => $uselines{$useline}, |
|
87 |
}; |
|
86 | 88 |
|
87 | 89 |
# build requirement tree |
88 | 90 |
for my $file (@{ $uselines{$useline} }) { |
... | ... | |
99 | 101 |
$changed = 0; |
100 | 102 |
for my $src_module (keys %requires) { |
101 | 103 |
for my $dst_module (keys %{ $requires{$src_module} }) { |
102 |
if ( $modules{$src_module} =~ /^required/ |
|
103 |
&& $modules{$dst_module} eq '!missing') { |
|
104 |
$modules{$dst_module} = "required"; # . ", via $src_module"; |
|
104 |
if ( $modules{$src_module} |
|
105 |
&& $modules{$dst_module} |
|
106 |
&& $modules{$src_module}->{status} =~ /^required/ |
|
107 |
&& $modules{$dst_module}->{status} eq '!missing') { |
|
108 |
$modules{$dst_module}->{status} = "required"; # . ", via $src_module"; |
|
105 | 109 |
$changed = 1; |
106 | 110 |
} |
107 | 111 |
} |
108 | 112 |
} |
109 | 113 |
} |
110 | 114 |
|
111 |
print sprintf "%8s : %s", color_text($modules{$_}), $_
|
|
115 |
print sprintf "%8s : %s (%s)", color_text($modules{$_}->{status}), $_, join(' ', @{ $modules{$_}->{files} || [] })
|
|
112 | 116 |
for sort { |
113 |
$modules{$a} cmp $modules{$b}
|
|
114 |
|| $a cmp $b |
|
117 |
$modules{$a}->{status} cmp $modules{$b}->{status}
|
|
118 |
|| $a cmp $b
|
|
115 | 119 |
} keys %modules; |
116 | 120 |
|
117 | 121 |
sub modulize { |
Auch abrufbar als: Unified diff
Ausgeben, welche Datei welches Modul benötigt