Remove Perl 4 sigils (PBP)

This commit is contained in:
Dan Church 2023-07-20 12:41:07 -05:00
parent 02f97c2a90
commit 907a7113a8
Signed by: h3xx
GPG key ID: EA2BF379CD2CDBD0
12 changed files with 56 additions and 56 deletions

View file

@ -37,9 +37,9 @@ sub are_hardlinked {
return "$dev:$ino";
};
my $starter_ident = &$gen_ident($starter);
my $starter_ident = $gen_ident->($starter);
foreach my $file (@_) {
if (&$gen_ident($file) ne $starter_ident) {
if ($gen_ident->($file) ne $starter_ident) {
return 0;
}
}
@ -62,7 +62,7 @@ sub filemtime {
sub has_mtime {
my $mtime = shift;
foreach my $file (@_) {
if (&filemtime($file) != $mtime) {
if (filemtime($file) != $mtime) {
return 0;
}
}
@ -80,11 +80,11 @@ sub mktempdir {
sub prep_tar {
my $tarball = shift // (dirname(__FILE__) . '/t.tar');
my $td = &mktempdir;
my $td = mktempdir();
# Note: Using chdir from Cwd automatically keeps $ENV{PWD} up-to-date (just
# in case)
my $oldpwd = &getcwd;
my $oldpwd = getcwd();
chdir $td;
my $tar = Archive::Tar->new;

View file

@ -7,13 +7,13 @@ use Test::Simple
use TestFunctions;
my $test_dir = &mktempdir;
&put_file(
my $test_dir = mktempdir();
put_file(
"$test_dir/1",
"$test_dir/2",
);
my (undef, $stdout, $stderr) = &run_script_capture('-f', $test_dir);
my (undef, $stdout, $stderr) = run_script_capture('-f', $test_dir);
ok "freed 1,048,576 bytes (1 MB)\n" eq $stderr, 'prints freed bytes with commas';
sub put_file {

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/freed-bytes";
my @files = (
"$test_dir/1",
@ -17,7 +17,7 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
my (undef, $stdout, $stderr) = &run_script_capture('-f', $test_dir, $test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok !are_hardlinked(@files), 'not hardlinked before we start';
my (undef, $stdout, $stderr) = run_script_capture('-f', $test_dir, $test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok "freed 24 bytes (24 B)\n" eq $stderr, 'prints correct number of freed bytes';

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/link-counting";
my @files = (
"$test_dir/most-links",
@ -15,7 +15,7 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
&run_script($test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok &are_hardlinked(@files), 'files with existing links got hardlinked';
ok !are_hardlinked(@files), 'not hardlinked before we start';
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok are_hardlinked(@files), 'files with existing links got hardlinked';

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/normal";
my @files = (
"$test_dir/foo/same",
@ -15,7 +15,7 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
&run_script($test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok &are_hardlinked(@files), 'files with the same contents got hardlinked';
ok !are_hardlinked(@files), 'not hardlinked before we start';
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok are_hardlinked(@files), 'files with the same contents got hardlinked';

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/normal";
my @files = (
"$test_dir/foo/same",
@ -15,7 +15,7 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
&run_script($test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok !&are_hardlinked(@files), 'files with different contents did not get hardlinked';
ok !are_hardlinked(@files), 'not hardlinked before we start';
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok !are_hardlinked(@files), 'files with different contents did not get hardlinked';

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/sha1-collision";
my @files = (
"$test_dir/shattered-1.pdf",
@ -15,7 +15,7 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
&run_script($test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok !&are_hardlinked(@files), 'files with the same SHA-1 hash did not get hardlinked';
ok !are_hardlinked(@files), 'not hardlinked before we start';
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok !are_hardlinked(@files), 'files with the same SHA-1 hash did not get hardlinked';

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/timestamp-preservation";
my @files = (
"$test_dir/newer-more-linked",
@ -15,9 +15,9 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
my $should_have_mtime = &filemtime($files[1]);
&run_script($test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok &are_hardlinked(@files);
ok &has_mtime($should_have_mtime, @files), 'timestamps updated to use oldest';
ok !are_hardlinked(@files), 'not hardlinked before we start';
my $should_have_mtime = filemtime($files[1]);
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok are_hardlinked(@files);
ok has_mtime($should_have_mtime, @files), 'timestamps updated to use oldest';

View file

@ -7,7 +7,7 @@ use Test::Simple
use TestFunctions;
my $tarball_dir = &prep_tar;
my $tarball_dir = prep_tar();
my $test_dir = "$tarball_dir/t/zero-size";
my @files = (
"$test_dir/empty1",
@ -15,7 +15,7 @@ my @files = (
);
# Smoke test
ok !&are_hardlinked(@files), 'not hardlinked before we start';
&run_script($test_dir);
ok &file_exists(@files), 'files were not accidentally deleted';
ok !&are_hardlinked(@files), 'zero-sized files did not get hardlinked';
ok !are_hardlinked(@files), 'not hardlinked before we start';
run_script($test_dir);
ok file_exists(@files), 'files were not accidentally deleted';
ok !are_hardlinked(@files), 'zero-sized files did not get hardlinked';