fix: Error with new 7.4 preload.custom. Added better sanity checking with messages.
This commit is contained in:
parent
8eb48e5464
commit
eabffb0342
1 changed files with 16 additions and 12 deletions
|
|
@ -2,19 +2,23 @@ my $webguiRoot;
|
||||||
my $customLibs;
|
my $customLibs;
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
$webguiRoot = "/data/WebGUI";
|
$webguiRoot = "/data/WebGUI";
|
||||||
unshift (@INC, $webguiRoot."/lib");
|
unshift (@INC, $webguiRoot."/lib");
|
||||||
@{$customLibs} = ();
|
@{$customLibs} = ();
|
||||||
open(FILE,"<".$webguiRoot."/sbin/preload.custom");
|
open(FILE,"<".$webguiRoot."/sbin/preload.custom");
|
||||||
while (my $line = <FILE>) {
|
while (my $line = <FILE>) {
|
||||||
next if $line =~ m/^#/;
|
chomp $line;
|
||||||
chomp $line;
|
next unless $line;
|
||||||
push(@{$customLibs}, $line);
|
if (!-d $line) {
|
||||||
}
|
print "WARNING: Not adding lib directory '$line' from $webguiRoot/sbin/preload.custom: Directory does not exist.\n";
|
||||||
close(FILE);
|
next;
|
||||||
foreach my $lib (@customLibs) {
|
|
||||||
unshift (@INC, $lib);
|
|
||||||
}
|
}
|
||||||
|
push(@{$customLibs}, $line);
|
||||||
|
}
|
||||||
|
close(FILE);
|
||||||
|
foreach my $lib (@{$customLibs}) {
|
||||||
|
unshift @INC, $lib;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$|=1;
|
$|=1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue