From 0ee33bbd23c4500b36c23da59db8f832f03b5c79 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 18 Jul 2013 02:21:18 +0200 Subject: Dpkg::Compression: Add new compression_get_file_extension_regex() function Replace all direct accesses to $compression_re_file_ext with calls to the new function, and mark the variable as deprecated to be removed on VERSION 2.00. Addresses Variables::ProhibitPackageVars. Warned-by: perlcritic --- scripts/Dpkg/Compression/FileHandle.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/Dpkg/Compression') diff --git a/scripts/Dpkg/Compression/FileHandle.pm b/scripts/Dpkg/Compression/FileHandle.pm index 884394cd4..4ca2a5909 100644 --- a/scripts/Dpkg/Compression/FileHandle.pm +++ b/scripts/Dpkg/Compression/FileHandle.pm @@ -306,7 +306,8 @@ sub set_filename { if (defined($add_comp_ext)) { *$self->{add_comp_ext} = $add_comp_ext; } - if (*$self->{add_comp_ext} and $filename =~ /\.$compression_re_file_ext$/) { + my $comp_ext_regex = compression_get_file_extension_regex(); + if (*$self->{add_comp_ext} and $filename =~ /\.$comp_ext_regex$/) { warning('filename %s already has an extension of a compressed file ' . 'and add_comp_ext is active', $filename); } -- cgit v1.2.3