Make sure $webguiRoot is setup consistently in all utility scripts.
Some scripts had a hardcoded use lib "../lib" and "../.." on Session/Config method calls. This was changed to a BEGIN prologue where @INC gets $webguiRoot added, and the method calls use $webguiRoot instead. This eases the creation of patches for filesystem reorganization of the installed files (e.g. for Debian packages).
This commit is contained in:
parent
8dc4216edd
commit
8be24aec80
8 changed files with 59 additions and 17 deletions
|
|
@ -8,10 +8,16 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
our ($webguiRoot);
|
||||
|
||||
BEGIN {
|
||||
$webguiRoot = "..";
|
||||
unshift (@INC, $webguiRoot."/lib");
|
||||
}
|
||||
|
||||
use Pod::Usage;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '../lib';
|
||||
use Getopt::Long;
|
||||
use POE::Component::IKC::ClientLite;
|
||||
use Spectre::Admin;
|
||||
|
|
@ -42,7 +48,7 @@ pod2usage( verbose => 2 ) if $help;
|
|||
pod2usage() unless ($ping||$shutdown||$daemon||$run||$test||$status);
|
||||
|
||||
require File::Spec;
|
||||
my $config = WebGUI::Config->new(File::Spec->rel2abs(".."),"spectre.conf",1);
|
||||
my $config = WebGUI::Config->new($webguiRoot,"spectre.conf",1);
|
||||
unless (defined $config) {
|
||||
print <<STOP;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue