From 6401ea3851caf3d3f7f5e6950eeb91304cdc6ce3 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 24 Feb 2010 06:51:25 +0000 Subject: [PATCH] defect 2946395: add subroutine getInstallDir git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5268 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Utils.pm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 7b895b8bd..edbd241b4 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -1205,6 +1205,46 @@ sub runxcmd_output #-------------------------------------------------------------------------------- +=head3 getInstallDir + + Get location of the directory, used to hold the node deployment packages. + + Arguments: + none + Returns: + path to install directory defined at site.installdir. + Globals: + none + Error: + none + Example: + $installdir = xCAT::Utils->getInstallDir(); + Comments: + none + +=cut + +#-------------------------------------------------------------------------------- + +sub getInstallDir +{ + # Default installdir location. Used by default in most Linux distros. + my $installdir = "/install"; + + # Try to lookup real installdir place. + my @installdir1 = get_site_attribute("installdir"); + + # Use fetched value, incase successful database lookup. + if ($installdir1[0]) + { + $installdir = $installdir1[0]; + } + + return $installdir; +} + +#-------------------------------------------------------------------------------- + =head3 getHomeDir Get the path the user home directory from /etc/passwd.