diff options
author | Guillem Jover <guillem@debian.org> | 2012-12-31 21:43:39 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-05-04 19:03:13 +0200 |
commit | 6a73e3078b01a71d4a6ea90c85da16523ed56f1d (patch) | |
tree | 4cc7a210e7e851395f7ba4989e3aac4aa9d32710 /scripts/Dpkg/Source/Package/V3/native.pm | |
parent | 62bc788a45e4a641c28ca9c8c5b9bb08f29faed8 (diff) | |
download | dpkg-6a73e3078b01a71d4a6ea90c85da16523ed56f1d.tar.gz |
Do not use double-quotes on strings that do not need interpolation
Using double-quotes imposes a small performance penalty as the perl
parser needs to check if any interpolation is needed. Use double-quotes
only when the string contains single-quotes. Ideally we'd use
double-quotes too for escaped meta-characters that might otherwise be
confusing to immediately see if they need interpolation or not, but the
policy does not (currently) allow to ignore these.
Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals.
Warned-by: perlcritic
Diffstat (limited to 'scripts/Dpkg/Source/Package/V3/native.pm')
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/native.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/Dpkg/Source/Package/V3/native.pm b/scripts/Dpkg/Source/Package/V3/native.pm index 726bc3905..de706f39a 100644 --- a/scripts/Dpkg/Source/Package/V3/native.pm +++ b/scripts/Dpkg/Source/Package/V3/native.pm @@ -18,7 +18,7 @@ package Dpkg::Source::Package::V3::native; use strict; use warnings; -our $VERSION = "0.01"; +our $VERSION = '0.01'; use base 'Dpkg::Source::Package'; @@ -34,7 +34,7 @@ use Cwd; use File::Basename; use File::Temp qw(tempfile); -our $CURRENT_MINOR_VERSION = "0"; +our $CURRENT_MINOR_VERSION = '0'; sub do_extract { my ($self, $newdirectory) = @_; @@ -48,17 +48,17 @@ sub do_extract { my $tarfile; foreach my $file ($self->get_files()) { if ($file =~ /^\Q$basenamerev\E\.tar\.$compression_re_file_ext$/) { - error(_g("multiple tarfiles in v1.0 source package")) if $tarfile; + error(_g('multiple tarfiles in v1.0 source package')) if $tarfile; $tarfile = $file; } else { - error(_g("unrecognized file for a native source package: %s"), $file); + error(_g('unrecognized file for a native source package: %s'), $file); } } - error(_g("no tarfile in Files field")) unless $tarfile; + error(_g('no tarfile in Files field')) unless $tarfile; erasedir($newdirectory); - info(_g("unpacking %s"), $tarfile); + info(_g('unpacking %s'), $tarfile); my $tar = Dpkg::Source::Archive->new(filename => "$dscdir$tarfile"); $tar->extract($newdirectory); } @@ -81,7 +81,7 @@ sub do_build { my $basenamerev = $self->get_basename(1); my $tarname = "$basenamerev.tar." . $self->{options}{comp_ext}; - info(_g("building %s in %s"), $sourcepackage, $tarname); + info(_g('building %s in %s'), $sourcepackage, $tarname); my ($ntfh, $newtar) = tempfile("$tarname.new.XXXXXX", DIR => getcwd(), UNLINK => 0); |