diff options
author | Francois Pons <fpons@mandriva.com> | 2003-08-06 15:54:26 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-08-06 15:54:26 +0000 |
commit | 206d19d511e549403660d9c2dfcf9f471ed669ff (patch) | |
tree | 0f768265618cd0c638b1634a9abfc200a4f600f6 /URPM/Signature.pm | |
parent | 702be5a6295afbda33d31d7f4492396371512638 (diff) | |
download | perl-URPM-206d19d511e549403660d9c2dfcf9f471ed669ff.tar perl-URPM-206d19d511e549403660d9c2dfcf9f471ed669ff.tar.gz perl-URPM-206d19d511e549403660d9c2dfcf9f471ed669ff.tar.bz2 perl-URPM-206d19d511e549403660d9c2dfcf9f471ed669ff.tar.xz perl-URPM-206d19d511e549403660d9c2dfcf9f471ed669ff.zip |
0.93-1mdk0.93
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 .= $_; } } } |