summaryrefslogtreecommitdiff
path: root/src/t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-12-30 01:35:10 +0100
committerGuillem Jover <guillem@debian.org>2013-04-28 00:18:01 +0200
commitfc4f53c4b7d0837bef169ce7cdc0abec124f2d7d (patch)
treefbf0010e0818db47250a8a04dcaa4fc8bace5f48 /src/t
parent9b590b2a54670c919a638a336769ae0687b2e72b (diff)
downloaddpkg-fc4f53c4b7d0837bef169ce7cdc0abec124f2d7d.tar.gz
Use proper variables instead of barewords for filehandles
Fixes InputOutput::ProhibitBarewordFileHandles. Warned-by: perlcritic
Diffstat (limited to 'src/t')
-rw-r--r--src/t/100_dpkg_divert.t24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/t/100_dpkg_divert.t b/src/t/100_dpkg_divert.t
index 114a1840f..311557c2f 100644
--- a/src/t/100_dpkg_divert.t
+++ b/src/t/100_dpkg_divert.t
@@ -48,21 +48,21 @@ sub cleanup {
sub install_diversions {
my ($txt) = @_;
- open(O, '>', "$admindir/diversions");
- print O $txt;
- close(O);
+ open(my $db_fh, '>', "$admindir/diversions");
+ print $db_fh $txt;
+ close($db_fh);
}
sub install_filelist {
my ($pkg, $arch, @files) = @_;
- open(L, '>', "$admindir/info/$pkg.list");
+ open(my $fileslist_fh, '>', "$admindir/info/$pkg.list");
for my $file (@files) {
- print L "$file\n";
+ print $fileslist_fh "$file\n";
}
- close(L);
+ close($fileslist_fh);
# Only installed packages have their files list considered.
- open(S, '>>', "$admindir/status");
- print S <<"EOF";
+ open(my $status_fh, '>>', "$admindir/status");
+ print $status_fh <<"EOF";
Package: $pkg
Status: install ok installed
Version: 0
@@ -71,7 +71,7 @@ Maintainer: dummy
Description: dummy
EOF
- close(S);
+ close($status_fh);
}
sub call {
@@ -134,9 +134,9 @@ sub diversions_pack {
sub diversions_eq {
my (@expected) = split /^/, shift;
- open(O, '<', "$admindir/diversions");
- my (@contents) = <O>;
- close(O);
+ open(my $db_fh, '<', "$admindir/diversions");
+ my (@contents) = <$db_fh>;
+ close($db_fh);
my (@expected_pack) = diversions_pack(@expected);
my (@contents_pack) = diversions_pack(@contents);