update for -s support more todo

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3400 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2009-05-18 18:15:47 +00:00
parent efcef6508b
commit 35e8b2be1d
2 changed files with 21 additions and 5 deletions

View File

@ -4136,11 +4136,18 @@ sub parse_and_run_dcp
# /....file* /...../sample* -> /..../directory
#
my @results;
my $syncSN = 0;
if ($options{'rsyncSN'})
{
$syncSN = 1;
}
if ($options{'File'})
{
@results =
&parse_rsync_input_file(\@nodelist, \%options, $options{'File'});
&parse_rsync_input_file(\@nodelist, \%options,
$options{'File'}, $syncSN);
# rdist not supported
#@results = &parse_rdist_input_file(\%options, $options{'File'});
}
else # source and destination files are from command line
@ -4232,7 +4239,7 @@ sub parse_and_run_dcp
sub parse_rsync_input_file
{
use File::Basename;
my ($nodes, $options, $input_file) = @_;
my ($nodes, $options, $input_file, $rsyncSN) = @_;
my @dest_host = @$nodes;
open(INPUTFILE, "< $input_file") || die "File $input_file does not exist\n";
while (my $line = <INPUTFILE>)
@ -4258,13 +4265,22 @@ sub parse_rsync_input_file
foreach my $target_node (@dest_host)
{
$$options{'destDir_srcFile'}{$target_node} ||= {};
$$options{'destDir_srcFile'}{$target_node}{$dest_dir} ||= {};
$$options{'destDir_srcFile'}{$target_node} ||= {};
# for each file on the line
foreach my $srcfile (@srcfiles)
{
# if syncing the Service Node, file goes to the same place
# from which it came
if ($rsyncSN == 1)
{ # syncing the SN
$dest_dir = dirname($srcfile);
$dest_dir =~ s/\s*//g; #remove blanks
}
$$options{'destDir_srcFile'}{$target_node}{$dest_dir} ||=
{};
# can be full file name for destination or just the
# directory name
my $src_basename = basename($srcfile); # get file name

View File

@ -417,7 +417,7 @@ sub parse_args_xdcp
'q|show-config' => \$options{'show-config'},
'p|preserve' => \$options{'preserve'},
'r|c|node-rcp=s' => \$options{'node-rcp'},
's' => \$options{'rsync'},
's' => \$options{'rsyncSN'},
't|timeout=i' => \$options{'timeout'},
'v|verify' => \$options{'verify'},
'B|bypass' => \$options{'bypass'},