-the defect 2987733 is fixed;

if the entry with one name ended with "/", "-l" should be used to detect whether it is a link or not


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5784 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mxi1 2010-04-16 01:40:33 +00:00
parent 0be60e14a1
commit c92210b1ef

View File

@ -229,13 +229,31 @@ sub process_request {
xCAT::Utils->runcmd("rm -rf $default", 0, 1); # not sure whether it's necessary right now
} else {
my $target = $rootimg_dir.$f;
if (-l $target) {
if (-l $target) { #not one directory
my $location = readlink $target;
# if it is not linked from tmpfs, it should be modified by the .postinstall file
if ($location =~ /\.statelite\/tmpfs/) {
xCAT::Utils->runcmd("rm -rf $target", 0, 1);
my $default = $rootimg_dir . "/.default" . $f;
xCAT::Utils->runcmd("cp -a $default $target", 0, 1);
if( -e $default) {
xCAT::Utils->runcmd("cp -a $default $target", 0, 1);
}else { # maybe someone deletes the copy in .default directory
xCAT::Utils->runcmd("touch $target", 0, 1);
}
}
} else {
chop $target;
if( -l $target ) {
my $location = readlink $target;
if ($location =~ /\.statelite\/tmpfs/) {
xCAT::Utils->runcmd("rm -rf $target", 0, 1);
my $default = $rootimg_dir . "/.default" . $f;
if( -e $default) {
xCAT::Utils->runcmd("cp -a $default $target", 0, 1);
} else {
xCAT::Utils->runcmd("mkdir $target", 0, 1);
}
}
}
}