Revision f2cee125
Von Sven Schöling vor fast 8 Jahren hinzugefügt
SL/LxOfficeConf.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
|
5 | 5 |
use Encode; |
6 |
use SL::System::Process; |
|
7 | 6 |
|
8 | 7 |
my $environment_initialized; |
9 | 8 |
|
10 | 9 |
sub safe_require { |
11 |
my ($class, $may_fail); |
|
10 |
my ($class, $may_fail) = @_;
|
|
12 | 11 |
|
13 |
my $failed = !eval { require Config::Std; }; |
|
14 |
|
|
15 |
if ($failed) { |
|
12 |
eval { |
|
13 |
require Config::Std; |
|
14 |
require SL::System::Process; |
|
15 |
1; |
|
16 |
} or do { |
|
16 | 17 |
if ($may_fail) { |
17 | 18 |
warn $@; |
18 | 19 |
return 0; |
19 | 20 |
} else { |
20 | 21 |
die $@; |
21 | 22 |
} |
22 |
} |
|
23 |
};
|
|
23 | 24 |
|
24 | 25 |
Config::Std->import; |
25 | 26 |
|
Auch abrufbar als: Unified diff
installation_check.pl: LxOfficeConf safe_require gefixt