Revision 4ab31a8f
Von Sven Schöling vor fast 13 Jahren hinzugefügt
SL/InstallationCheck.pm | ||
---|---|---|
51 | 51 |
my $module = $_[0]; |
52 | 52 |
my $version = $_[1] || '' ; |
53 | 53 |
|
54 |
return eval "use $module $version; 1"; |
|
54 |
my $got = eval "use $module $version; 1"; |
|
55 |
|
|
56 |
if ($got) { |
|
57 |
return ($got, $module->VERSION); |
|
58 |
} else { |
|
59 |
return |
|
60 |
} |
|
55 | 61 |
} |
56 | 62 |
|
57 | 63 |
sub check_kpsewhich { |
scripts/installation_check.pl | ||
---|---|---|
123 | 123 |
my ($module, %role) = @_; |
124 | 124 |
|
125 | 125 |
my $line = "Looking for $module->{fullname}"; |
126 |
my $res = SL::InstallationCheck::module_available($module->{"name"}, $module->{version}); |
|
127 |
print_result($line, $res); |
|
126 |
my ($res, $ver) = SL::InstallationCheck::module_available($module->{"name"}, $module->{version}); |
|
127 |
if ($res) { |
|
128 |
print_line($line, $ver || 'no version', 'green'); |
|
129 |
} else { |
|
130 |
print_result($line, $res); |
|
131 |
} |
|
132 |
|
|
128 | 133 |
|
129 | 134 |
return if $res; |
130 | 135 |
|
... | ... | |
178 | 183 |
|
179 | 184 |
sub print_result { |
180 | 185 |
my ($test, $exit) = @_; |
181 |
print $test, " ", ('.' x (72 - length $test)); |
|
182 |
print $exit ? '.... '. mycolor('ok', 'green') : ' '. mycolor('NOT ok', 'red'); |
|
186 |
if ($exit) { |
|
187 |
print_line($test, 'ok', 'green'); |
|
188 |
} else { |
|
189 |
print_line($test, 'NOT ok', 'red'); |
|
190 |
} |
|
191 |
} |
|
192 |
|
|
193 |
sub print_line { |
|
194 |
my ($text, $res, $color) = @_; |
|
195 |
print $text, " ", ('.' x (78 - length($text) - length($res))); |
|
196 |
print mycolor($res, $color); |
|
183 | 197 |
print "\n"; |
184 | 198 |
return; |
185 | 199 |
} |
Auch abrufbar als: Unified diff
Versionen im installcheck anzeigen.