fix: Error with new 7.4 preload.custom. Added better sanity checking with messages.

This commit is contained in:
Doug Bell 2007-07-10 21:25:54 +00:00
parent 8eb48e5464
commit eabffb0342

View file

@ -2,19 +2,23 @@ my $webguiRoot;
my $customLibs;
BEGIN {
$webguiRoot = "/data/WebGUI";
unshift (@INC, $webguiRoot."/lib");
@{$customLibs} = ();
open(FILE,"<".$webguiRoot."/sbin/preload.custom");
while (my $line = <FILE>) {
next if $line =~ m/^#/;
chomp $line;
push(@{$customLibs}, $line);
}
close(FILE);
foreach my $lib (@customLibs) {
unshift (@INC, $lib);
$webguiRoot = "/data/WebGUI";
unshift (@INC, $webguiRoot."/lib");
@{$customLibs} = ();
open(FILE,"<".$webguiRoot."/sbin/preload.custom");
while (my $line = <FILE>) {
chomp $line;
next unless $line;
if (!-d $line) {
print "WARNING: Not adding lib directory '$line' from $webguiRoot/sbin/preload.custom: Directory does not exist.\n";
next;
}
push(@{$customLibs}, $line);
}
close(FILE);
foreach my $lib (@{$customLibs}) {
unshift @INC, $lib;
}
}
$|=1;