diff options
Diffstat (limited to 'URPM/Signature.pm')
-rw-r--r-- | URPM/Signature.pm | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/URPM/Signature.pm b/URPM/Signature.pm index 4e7ef70..5e90d09 100644 --- a/URPM/Signature.pm +++ b/URPM/Signature.pm @@ -5,7 +5,7 @@ use strict; #- parse an armored file and import in keys hash if the key does not already exists. sub parse_armored_file { my ($urpm, $file) = @_; - my ($block, @l, $contents); + my ($block, @l, $content); local (*F, $_); #- read armored file. @@ -17,11 +17,11 @@ sub parse_armored_file { my $inside_block = /^$/ ... /^-----END PGP PUBLIC KEY BLOCK-----$/; if ($inside_block > 1) { if ($inside_block =~ /E/) { - push @l, $contents; + push @l, $content; $block = undef; - $contents = ''; + $content = ''; } else { - $contents .= $_; + $content .= $_; } } } @@ -35,20 +35,20 @@ sub parse_armored_file { #- check if key has been found, remove from list. @l = grep { my $found = 0; - foreach my $k (values %{$urpm->{keys}}) { - $k->{contents} eq $_ and $found = 1, last; + foreach my $k (values %{$urpm->{keys} || {}}) { + $k->{content} eq $_ and $found = 1, last; } !$found; } @l; #- now return something (true) which reflect what should be found in keys. - map { +{ contents => $_ } } @l; + map { +{ content => $_ } } @l; } -#- pare from rpmdb. -sub parse_rpmdb_pubkeys { +#- pare from rpmlib db. +sub parse_pubkeys { my ($urpm, $db) = @_; - my ($block, @l, $contents); + my ($block, @l, $content); $db->traverse_tag('name', [ 'gpg-pubkey' ], sub { my ($p) = @_; @@ -61,12 +61,12 @@ sub parse_rpmdb_pubkeys { if ($inside_block =~ /E/) { $urpm->{keys}{$p->version} = { $p->summary =~ /^gpg\(\)$/ ? (name => $1) : @{[]}, id => $p->version, - contents => $contents, + content => $content, }; $block = undef; - $contents = ''; + $content = ''; } else { - $contents .= $_; + $content .= $_; } } } |