Set XCATROOT to default to /usr if no evironment variable and /opt/xcat does not exist

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@258 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
andywray 2008-01-14 16:58:23 +00:00
parent 8c6698d45d
commit 5653e63504
4 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,7 @@
package xCAT::Client;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
}
use lib "$::XCATROOT/lib/perl";
use xCAT::NodeRange;

View File

@ -3602,8 +3602,10 @@ sub parse_and_run_dsh
if ($ENV{'XCATROOT'})
{
$::XCATROOT = $ENV{'XCATROOT'}; # setup xcatroot home directory
} else {
} elsif (-d '/opt/xcat') {
$::XCATROOT = "/opt/xcat";
} else {
$::XCATROOT = "/usr";
}
# parse the arguments

View File

@ -3,7 +3,7 @@
package xCAT::NotifHandler;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
}
use lib "$::XCATROOT/lib/perl";

View File

@ -9,7 +9,7 @@
package xCAT::Table;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
}
use lib "$::XCATROOT/lib/perl";