From 2ceda6a730f7c9354cd6ac80f755992cc2a1d3e4 Mon Sep 17 00:00:00 2001 From: Aurélien Aptel Date: Mon, 5 Aug 2013 18:58:39 +0200 Subject: test_smbclient_tarmode.pl: remove all ./ prefix when dealing with remote files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Aptel Reviewed-by: David Disseldorp Reviewed-by: Jim McDonough --- source3/script/tests/test_smbclient_tarmode.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source3/script') diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl index 83be0697600..879fd5dc0e8 100755 --- a/source3/script/tests/test_smbclient_tarmode.pl +++ b/source3/script/tests/test_smbclient_tarmode.pl @@ -955,6 +955,13 @@ sub file_list { return $s; } +# remove leading "./" +sub remove_dot { + my $s = shift; + $s =~ s{^\./}{}; + $s; +} + =head3 C Check if C<$remotepath> has B all the C<@files>. @@ -970,12 +977,13 @@ sub check_remote { my (@less, @more, @diff); for (@$files) { - $expected{$_->remotepath} = $_; - $done{$_->remotepath} = 0; + my $fn = remove_dot($_->remotepath); + $expected{$fn} = $_; + $done{$fn} = 0; } my %remote; - File::walk(sub { $remote{$_->remotepath} = $_ }, File::tree($subpath)); + File::walk(sub { $remote{remove_dot($_->remotepath)} = $_ }, File::tree($subpath)); for my $rfile (sort keys %remote) { -- cgit