From 491df32fa79137cc8763e8fa68ab6b7098f0d9a9 Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 27 Aug 2009 16:30:08 +0000 Subject: [PATCH] change to support new rsync file syntax, either file1 file2 -> directory or file -> file git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4049 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/DSHCLI.pm | 73 ++++++++++++---------------------------- 1 file changed, 21 insertions(+), 52 deletions(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 528c70927..824566b6c 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -3433,8 +3433,7 @@ sub usage_dsh ## usage message my $usagemsg1 = " xdsh -h \n xdsh -q \n xdsh -V \n"; my $usagemsg1a = "xdsh [noderange] -K [-l logonuserid]\n"; - my $usagemsg2 = - " [-B bypass ] [-c] [-e] [-E environment_file] + my $usagemsg2 = " [-B bypass ] [-c] [-e] [-E environment_file] [--devicetype type_of_device] [-f fanout]\n"; my $usagemsg3 = " [-l user_ID] [-L] "; my $usagemsg4 = "[-m] [-o options][-q] [-Q] [-r remote_shell] @@ -3823,8 +3822,7 @@ sub usage_dcp { ### usage message my $usagemsg1 = " xdcp -h \n xdcp -q\n xdcp -V \n xdcp [noderange]\n"; - my $usagemsg2 = - " [-B bypass] [-c] [-f fanout] [-l user_ID]\n"; + my $usagemsg2 = " [-B bypass] [-c] [-f fanout] [-l user_ID]\n"; my $usagemsg3 = " [-o options] [-p] [-P] [-q] [-Q] [-r node_remote_copy]\n"; my $usagemsg4 = @@ -4395,11 +4393,11 @@ sub parse_rsync_input_file_on_MN chomp $line; if ($line =~ /^#/) # skip commments { - next; + next; } if ($line =~ /(.+) -> (.+)/) { - + $process_line = 1; my $src_file = $1; my $dest_file = $2; @@ -4407,32 +4405,17 @@ sub parse_rsync_input_file_on_MN my @srcfiles = (split ' ', $src_file); my $arraysize = scalar @srcfiles; # of source files on the line my $dest_dir; - if (-e $dest_file) - { # if dest file exist - if (-d $dest_file) - { # if a directory , just use - $dest_dir = $dest_file; - } - else - { # strip off the file - $dest_dir = dirname($dest_file); - } - } - else + # if more than one file on the line then + # the destination is a directory + # else assume a file + if ($arraysize > 1) { - - # does not exist, if only more than one file on the line - # assume that the destination is a directory - # else assume a file - if ($arraysize > 1) - { - $dest_dir = $dest_file; - } - else - { - $dest_dir = dirname($dest_file); - } + $dest_dir = $dest_file; + } + else # only one file + { # strip off the file + $dest_dir = dirname($dest_file); } $dest_dir =~ s/\s*//g; #remove blanks @@ -4581,31 +4564,17 @@ sub parse_rsync_input_file_on_SN my @srcfiles = (split ' ', $src_file); my $arraysize = scalar @srcfiles; # of source files on the line my $dest_dir; - if (-e $dest_file) - { - if (-d $dest_file) - { # if a directory , just use - $dest_dir = $dest_file; - } - else - { # strip off the file - $dest_dir = dirname($dest_file); - } + # if only more than one file on the line + # then the destination is a directory + # else a file, + if ($arraysize > 1) + { + $dest_dir = $dest_file; } else - { # destination does not exist - # does not exist, if only more than one file on the line - # assume that the destination is a directory - # else assume a file - if ($arraysize > 1) - { - $dest_dir = $dest_file; - } - else - { - $dest_dir = dirname($dest_file); - } + { + $dest_dir = dirname($dest_file); } $dest_dir =~ s/\s*//g; #remove blanks