diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2013-08-12 16:29:41 +0200 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2013-11-05 08:42:43 -0500 |
commit | 1424c61a1a42abd34d71b0b48ea56be4b7fe5a9c (patch) | |
tree | ff12e10898c50be1e33fa35f906d870a88b66d1e /source3 | |
parent | 2ceda6a730f7c9354cd6ac80f755992cc2a1d3e4 (diff) | |
download | samba-1424c61a1a42abd34d71b0b48ea56be4b7fe5a9c.tar.gz samba-1424c61a1a42abd34d71b0b48ea56be4b7fe5a9c.tar.xz samba-1424c61a1a42abd34d71b0b48ea56be4b7fe5a9c.zip |
test_smbclient_tarmode.pl: depend only on perl v5.10
Signed-off-by: Aurélien Aptel <aurelien.aptel@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/test_smbclient_tarmode.pl | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/source3/script/tests/test_smbclient_tarmode.pl b/source3/script/tests/test_smbclient_tarmode.pl index 879fd5dc0e8..26eab300d83 100755 --- a/source3/script/tests/test_smbclient_tarmode.pl +++ b/source3/script/tests/test_smbclient_tarmode.pl @@ -23,10 +23,9 @@ C<test_smbclient_tarmode.pl> - Test for smbclient tar backup feature =cut -use v5.14; +use v5.10; use strict; use warnings; -no warnings 'experimental::smartmatch'; use Archive::Tar; use Data::Dumper; @@ -832,13 +831,13 @@ sub parse_test_string { } for (split /,/, $s) { - when (/^\d+$/) { + if (/^\d+$/) { if ($_ >= @TESTS) { return (); } push @tests, $TESTS[$_]; } - when (/^(\d+)-(\d+)$/) { + elsif (/^(\d+)-(\d+)$/) { my ($min, $max) = sort ($1, $2); if ($max >= @TESTS) { return (); @@ -848,7 +847,7 @@ sub parse_test_string { push @tests, $TESTS[$_]; } } - default { + else { return (); } } @@ -1062,7 +1061,8 @@ sub check_tar { while (my $f = $i->()) { if ($f->has_content) { $total++; - my $p = $f->full_path =~ s{^\./+}{}r; + my $p = $f->full_path; + $p =~ s{^\./+}{}; # file that shouldn't be there if (!exists $done{$p}) { @@ -1137,7 +1137,9 @@ sub smb_client { join(' ', map {quotemeta} (@SMBARGS, @args))); if ($DEBUG) { - say color('bold yellow'),$cmd =~ s{\\([./+-])}{$1}gr,color('reset'); + my $tmp = $cmd; + $tmp =~ s{\\([./+-])}{$1}g; + say color('bold yellow'), $tmp, color('reset'); } my $out = `$cmd 2>&1`; @@ -1330,7 +1332,9 @@ Return C<undef> if the file is local. sub remotepath { my ($s) = @_; return undef if !$s->{remote}; - cleanpath(($s->{dir}.'/'.$s->{name}) =~ s{^/}{}r); + my $r = $s->{dir}.'/'.$s->{name}; + $r =~ s{^/}{}; + return cleanpath($r); } @@ -1357,7 +1361,9 @@ Like C<< $f->remotepath >> but prefixed with F<./> sub tarpath { my $s = shift; return undef if !$s->{remote}; - $s->remotepath =~ s{^\./+}{}r; + my $r = $s->remotepath; + $r =~ s{^\./+}{}; + return $r; } =head4 C<< $f->delete_on_destruction( 0 ) >> @@ -1533,6 +1539,7 @@ sub list { $path ||= '/'; my @files; my $out = main::smb_client('-D', $path, '-c', 'ls'); + $path =~ s{^/}{}; for (split /\n/, $out) { next if !/^ (.+?)\s+([AHSRDN]*)\s+(\d+)\s+(.+)/o; @@ -1541,7 +1548,7 @@ sub list { push @files, bless { 'remote' => 1, - 'dir' => $path =~ s{^/}{}r, + 'dir' => $path, 'name' => $fn, 'size' => int($size), 'date' => $date, |