summaryrefslogtreecommitdiff
path: root/scripts/changelog/debian.pl
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-12-31 21:43:39 +0100
committerGuillem Jover <guillem@debian.org>2013-05-04 19:03:13 +0200
commit6a73e3078b01a71d4a6ea90c85da16523ed56f1d (patch)
tree4cc7a210e7e851395f7ba4989e3aac4aa9d32710 /scripts/changelog/debian.pl
parent62bc788a45e4a641c28ca9c8c5b9bb08f29faed8 (diff)
downloaddpkg-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/changelog/debian.pl')
-rwxr-xr-xscripts/changelog/debian.pl37
1 files changed, 19 insertions, 18 deletions
diff --git a/scripts/changelog/debian.pl b/scripts/changelog/debian.pl
index 0fb2fff62..cf6e9bf24 100755
--- a/scripts/changelog/debian.pl
+++ b/scripts/changelog/debian.pl
@@ -29,17 +29,17 @@ use Dpkg::Gettext;
use Dpkg::ErrorHandling;
use Dpkg::Changelog::Debian;
-textdomain("dpkg-dev");
+textdomain('dpkg-dev');
$progname = "parsechangelog/$progname";
sub version {
printf _g("Debian %s version %s.\n"), $progname, $version;
- printf _g("
+ printf _g('
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
-");
+');
}
sub usage {
@@ -89,19 +89,20 @@ sub set_format {
$format = $val;
}
-GetOptions( "file=s" => \$file,
- "label|l=s" => \$label,
- "since|v=s" => \$since,
- "until|u=s" => \$until,
- "from|f=s" => \$from,
- "to|t=s" => \$to,
- "count|c|n=i" => \$count,
- "offset|o=i" => \$offset,
- "help|?" => sub{ usage(); exit(0) },
- "version|V" => sub{version();exit(0)},
- "format=s" => \&set_format,
- "all|a" => \$all,
- )
+GetOptions(
+ 'file=s' => \$file,
+ 'label|l=s' => \$label,
+ 'since|v=s' => \$since,
+ 'until|u=s' => \$until,
+ 'from|f=s' => \$from,
+ 'to|t=s' => \$to,
+ 'count|c|n=i' => \$count,
+ 'offset|o=i' => \$offset,
+ 'help|?' => sub{ usage(); exit(0) },
+ 'version|V' => sub{version();exit(0)},
+ 'format=s' => \&set_format,
+ 'all|a' => \$all,
+)
or do { usage(); exit(2) };
usageerr('too many arguments') if @ARGV > 1;
@@ -132,7 +133,7 @@ my $range = {
my $changes = Dpkg::Changelog::Debian->new(reportfile => $label, range => $range);
if ($file eq '-') {
- $changes->parse(\*STDIN, _g("<standard input>"))
+ $changes->parse(\*STDIN, _g('<standard input>'))
or error(_g('fatal error occurred while parsing input'));
} else {
$changes->load($file)
@@ -144,5 +145,5 @@ eval qq{
print \$output if defined \$output;
};
if ($@) {
- error("%s", $@);
+ error('%s', $@);
}