From c51cfca5e1c98ce3a1be7abdd68078932652baef Mon Sep 17 00:00:00 2001 From: chudegao Date: Wed, 11 Mar 2015 18:02:31 +0800 Subject: [PATCH] fix feature request 189, support not contain existing postscript in kit --- xCAT-server/lib/xcat/plugins/kit.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 7f07f9f72..20a771fbe 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -1346,16 +1346,16 @@ sub addkit } else { $rc = system("cp -rf $kitdir/other_files/$_ $installdir/postscripts/"); } + if($rc && !-e "$installdir/postscripts/$_"){ + my %rsp; + push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts"; + xCAT::MsgUtils->message( "E", \%rsp, $callback ); + return 1; + } + $rc = 0; chmod(0755,"$installdir/postscripts/$_"); } - if($rc){ - my %rsp; - push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts"; - xCAT::MsgUtils->message( "E", \%rsp, $callback ); - return 1; - } - # Copying plugins to /opt/xcat/lib/perl/xCAT_plugin/ if ( -d "$kitdir/plugins/" ) {