aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Signature.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-21 09:16:18 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-04-21 09:16:18 +0000
commit9d9208eb06bccc058a118801108ef558494c6cc9 (patch)
tree8b61b1a4ea8d680953dfb9ab5e73c9a1894995f7 /URPM/Signature.pm
parente3b856e8c64d035e7f6f7d7b2e06d06446eb64f0 (diff)
downloadperl-URPM-9d9208eb06bccc058a118801108ef558494c6cc9.tar
perl-URPM-9d9208eb06bccc058a118801108ef558494c6cc9.tar.gz
perl-URPM-9d9208eb06bccc058a118801108ef558494c6cc9.tar.bz2
perl-URPM-9d9208eb06bccc058a118801108ef558494c6cc9.tar.xz
perl-URPM-9d9208eb06bccc058a118801108ef558494c6cc9.zip
More cleanup.
Diffstat (limited to 'URPM/Signature.pm')
-rw-r--r--URPM/Signature.pm49
1 files changed, 24 insertions, 25 deletions
diff --git a/URPM/Signature.pm b/URPM/Signature.pm
index 1baa9a4..6831680 100644
--- a/URPM/Signature.pm
+++ b/URPM/Signature.pm
@@ -27,7 +27,7 @@ sub compare_pubkeys {
#- parse an armored file and import in keys hash if the key does not already exists.
sub parse_armored_file {
- my ($urpm, $file, %options) = @_;
+ my (undef, $file) = @_;
my ($block, $content, @l);
#- check if an already opened file has been given directly.
@@ -61,40 +61,39 @@ sub parse_armored_file {
#- pare from rpmlib db.
sub parse_pubkeys {
my ($urpm, %options) = @_;
- my ($block, @l, $content);
+ my ($block, $content);
my $db = $options{db};
$db ||= URPM::DB::open($options{root});
$db->traverse_tag('name', [ 'gpg-pubkey' ], sub {
- my ($p) = @_;
- my $s;
- foreach (split "\n", $p->description) {
- $block ||= /^-----BEGIN PGP PUBLIC KEY BLOCK-----$/;
- if ($block) {
- my $inside_block = /^$/ ... /^-----END PGP PUBLIC KEY BLOCK-----$/;
- if ($inside_block > 1) {
- if ($inside_block =~ /E/) {
- $urpm->{keys}{$p->version} = { $p->summary =~ /^gpg\((.*)\)$/ ? (name => $1) : @{[]},
- id => $p->version,
- content => $content,
- block => $p->description,
- };
- $block = undef;
- $content = '';
- } else {
- $content .= $_;
- }
- }
- }
- }
- })
+ my ($p) = @_;
+ foreach (split "\n", $p->description) {
+ $block ||= /^-----BEGIN PGP PUBLIC KEY BLOCK-----$/;
+ if ($block) {
+ my $inside_block = /^$/ ... /^-----END PGP PUBLIC KEY BLOCK-----$/;
+ if ($inside_block > 1) {
+ if ($inside_block =~ /E/) {
+ $urpm->{keys}{$p->version} = {
+ $p->summary =~ /^gpg\((.*)\)$/ ? (name => $1) : @{[]},
+ id => $p->version,
+ content => $content,
+ block => $p->description,
+ };
+ $block = undef;
+ $content = '';
+ } else {
+ $content .= $_;
+ }
+ }
+ }
+ }
+ });
}
#- import pubkeys only if it is needed.
sub import_needed_pubkeys {
my ($urpm, $l, %options) = @_;
- my $block = '';
#- use the same database handle to avoid re-opening multiple times the database.
my $db = $options{db};