diff options
author | Francois Pons <fpons@mandriva.com> | 2003-08-21 13:25:40 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-08-21 13:25:40 +0000 |
commit | 81c5765611fa53b88569da827ec913b2fb61fb1a (patch) | |
tree | 036ffc9058176b1b85b1fadbefbc57d95ef5a982 /perl-install/install_any.pm | |
parent | 3723df440854be7311f79bf46557e5da4a9e792c (diff) | |
download | drakx-81c5765611fa53b88569da827ec913b2fb61fb1a.tar drakx-81c5765611fa53b88569da827ec913b2fb61fb1a.tar.gz drakx-81c5765611fa53b88569da827ec913b2fb61fb1a.tar.bz2 drakx-81c5765611fa53b88569da827ec913b2fb61fb1a.tar.xz drakx-81c5765611fa53b88569da827ec913b2fb61fb1a.zip |
updated with new perl-URPM 0.94 (simplified code)
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 582f0951b..0e16916a9 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -499,29 +499,16 @@ sub install_urpmi { delete $packages->{rpmdb}; #- import pubkey in rpmdb. - require URPM::Signature; my $db = pkgs::rpmDbOpenForInstall($prefix); $packages->parse_pubkeys(db => $db); foreach my $medium (values %$mediums) { - foreach my $k (@{$medium->{pubkey}}) { - my $id; - foreach my $kv (values %{$packages->{keys} || {}}) { - URPM::compare_pubkeys($k, $kv) == 0 and $id = $kv->{id}, last; - } - unless ($id) { - log::l("importing pubkey block"); - URPM::import_pubkey(block => $k->{block}, db => $db); - $packages->parse_pubkeys(db => $db); - foreach my $kv (values %{$packages->{keys} || {}}) { - URPM::compare_pubkeys($k, $kv) == 0 and $id = $kv->{id}, last; - } - } - #- the key has been found, take care of it for the given medium. - if ($id) { - log::l("found key id=$id for medium $medium->{descr}"); - $medium->{key_ids}{$id} = undef; - } - } + $packages->import_needed_pubkeys($medium->{pubkey}, db => $db, callback => sub { + my (undef, undef, $k, $id, $imported) = @_; + if ($id) { + log::l(($imported ? "imported" : "found")." key=$id for medium $medium->{descr}"); + $medium->{key_ids}{$id} = undef; + } + }); } my @cfg; |