summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Control/HashCore.pm
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-07-25 03:31:01 +0200
committerGuillem Jover <guillem@debian.org>2013-07-26 23:53:33 +0200
commitbb38862b4a6232b89f5f20abbb5d20756b34d4d6 (patch)
treeac27318230ef7b902b06d24cd9eb18b9a9e49051 /scripts/Dpkg/Control/HashCore.pm
parent649c745f7ea21ec2628e2b039c7590f3934d7195 (diff)
downloaddpkg-bb38862b4a6232b89f5f20abbb5d20756b34d4d6.tar.gz
Dpkg::Source::Package: Do not scan control file twice for PGP signature
The code was pre-scanning the control file looking for a PGP signature, and the parser was doing a more thorough check later on. Just remove the double parsing, and rely on the more accurate one from the parser.
Diffstat (limited to 'scripts/Dpkg/Control/HashCore.pm')
-rw-r--r--scripts/Dpkg/Control/HashCore.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm
index 236e111b4..51cfc5a33 100644
--- a/scripts/Dpkg/Control/HashCore.pm
+++ b/scripts/Dpkg/Control/HashCore.pm
@@ -105,6 +105,7 @@ sub new {
my $self = \{
in_order => [],
out_order => [],
+ is_pgp_signed => 0,
allow_pgp => 0,
allow_duplicate => 0,
drop_empty => 0,
@@ -172,7 +173,6 @@ sub parse {
my $parabody = 0;
my $cf; # Current field
my $expect_pgp_sig = 0;
- my $pgp_signed = 0;
while (<$fh>) {
s/\s*\n$//;
@@ -229,7 +229,7 @@ sub parse {
}
# This does not mean the signature is correct, that needs to
# be verified by gnupg.
- $pgp_signed = 1;
+ $$self->{is_pgp_signed} = 1;
}
last; # Finished parsing one block
} else {
@@ -238,7 +238,7 @@ sub parse {
}
}
- if ($expect_pgp_sig and not $pgp_signed) {
+ if ($expect_pgp_sig and not $$self->{is_pgp_signed}) {
syntaxerr($desc, _g('unfinished PGP signature'));
}