From: cbarratt Date: Fri, 7 Feb 2003 05:51:22 +0000 (+0000) Subject: Try again; cvs got an error: X-Git-Tag: v2_0_0beta0~5 X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=commitdiff_plain;h=d367eab2497fd9d7510c8b831651c1f0f0c41c06 Try again; cvs got an error: - Fixed rsync is case of shareName = '/' - Repaired host name regex to correctly allow '-' in host name - Added sshPath to Pre/Post command vars - Ensured child exited after failed exec for Pre/Post commands - Added space before $I_option in Smb. - Made $I_option a listref, rather than string, for Smb --- diff --git a/lib/BackupPC/Lib.pm b/lib/BackupPC/Lib.pm index 8cc1e83..e061eee 100644 --- a/lib/BackupPC/Lib.pm +++ b/lib/BackupPC/Lib.pm @@ -314,7 +314,7 @@ sub HostInfoRead s/[\n\r]+//; s/#.*//; s/\s+$//; - next if ( /^\s*$/ || !/^([\w\.-\\]+\s+.*)/ ); + next if ( /^\s*$/ || !/^([\w\.\\-]+\s+.*)/ ); # # Split on white space, except if preceded by \ # using zero-width negative look-behind assertion @@ -985,6 +985,8 @@ sub cmdSystemOrEval close(STDERR); open(STDERR, ">&STDOUT"); exec(@$cmd); + print("Exec of @$cmd failed\n"); + exit(1); } # # The parent gathers the output from the child diff --git a/lib/BackupPC/Xfer/Rsync.pm b/lib/BackupPC/Xfer/Rsync.pm index 11103ca..cf20d64 100644 --- a/lib/BackupPC/Xfer/Rsync.pm +++ b/lib/BackupPC/Xfer/Rsync.pm @@ -119,7 +119,7 @@ sub start # # We add a slash to the share name we pass to rsync # - ($t->{shareNameSlash} = "$t->{shareName}/") =~ s{//+$}{}; + ($t->{shareNameSlash} = "$t->{shareName}/") =~ s{//+$}{/}; if ( $t->{type} eq "restore" ) { $rsyncClientCmd = $conf->{RsyncClientRestoreCmd}; diff --git a/lib/BackupPC/Xfer/Smb.pm b/lib/BackupPC/Xfer/Smb.pm index bfd367a..d3b688b 100644 --- a/lib/BackupPC/Xfer/Smb.pm +++ b/lib/BackupPC/Xfer/Smb.pm @@ -78,7 +78,7 @@ sub start my($t) = @_; my $bpc = $t->{bpc}; my $conf = $t->{conf}; - my $I_option = $t->{hostIP} eq $t->{host} ? "" : " -I $t->{hostIP}"; + my $I_option = $t->{hostIP} eq $t->{host} ? [] : ['-I', $t->{hostIP}]; my(@fileList, $X_option, $smbClientCmd, $logMsg); my($timeStampFile); local(*SMB);