1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

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>
This commit is contained in:
Aurélien Aptel 2013-08-05 18:58:39 +02:00 committed by Jim McDonough
parent 7088302d24
commit 2ceda6a730

View File

@ -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) {