diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2013-08-05 18:58:39 +0200 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2013-11-05 08:42:43 -0500 |
commit | 2ceda6a730f7c9354cd6ac80f755992cc2a1d3e4 (patch) | |
tree | 459bc7a3990e8977e414f03a142db3019f737a9c | |
parent | 7088302d2469a0191f7b3e7d396575e7f688dde3 (diff) | |
download | samba-2ceda6a730f7c9354cd6ac80f755992cc2a1d3e4.tar.gz samba-2ceda6a730f7c9354cd6ac80f755992cc2a1d3e4.tar.xz samba-2ceda6a730f7c9354cd6ac80f755992cc2a1d3e4.zip |
test_smbclient_tarmode.pl: remove all ./ prefix when dealing with remote files
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
-rwxr-xr-x | source3/script/tests/test_smbclient_tarmode.pl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl index 83be069760..879fd5dc0e 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_remote( $remotepath, \@files )> Check if C<$remotepath> has B<exactly> 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) { |