diff options
author | Francois Pons <fpons@mandriva.com> | 2003-08-20 18:53:44 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-08-20 18:53:44 +0000 |
commit | 5342cb105b215db10fe1c888a63d295208f62377 (patch) | |
tree | bf1fb1c791edb89e27add527050a4f4bf45f7a29 | |
parent | 16ff4764bfb47cc85603413b6665c7aded1f7f2e (diff) | |
download | drakx-5342cb105b215db10fe1c888a63d295208f62377.tar drakx-5342cb105b215db10fe1c888a63d295208f62377.tar.gz drakx-5342cb105b215db10fe1c888a63d295208f62377.tar.bz2 drakx-5342cb105b215db10fe1c888a63d295208f62377.tar.xz drakx-5342cb105b215db10fe1c888a63d295208f62377.zip |
added pubkey and rpmdb key importation.
-rw-r--r-- | perl-install/install_any.pm | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index a79cd828f..e5fd77395 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -495,6 +495,30 @@ sub install_urpmi { #- rare case where urpmi cannot be installed (no hd install path). $method eq 'disk' && !any::hdInstallPath() and return; + #- clean to avoid opening twice the rpm db. + delete $packages->{rpmdb}; + + #- import pubkey in rpmdb. + my $db = pkgs::rpmDbOpenForInstall($prefix); + $packages->parse_pubkeys(db => $db); + foreach (values %$mediums) { + foreach my $k (@{$_->{pubkey}}) { + my $id; + foreach my $kv (values %{$packages->{keys} || {}}) { + URPM::compare_pubkeys($k, $kv) == 0 and $id = $kv->{id}, last; + } + unless ($id) { + 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. + $id and $_->{key_ids}{$id} = undef; + } + } + my @cfg; foreach (sort { $a->{medium} <=> $b->{medium} } values %$mediums) { my $name = $_->{fakemedium}; @@ -566,7 +590,8 @@ sub install_urpmi { push @cfg, "$qname " . ($need_list ? "" : $qdir) . " { hdlist: hdlist.$name.cz with_hdlist: $with" . ($need_list ? " - list: list.$name" : "") . ($dir =~ /removable:/ && " + list: list.$name" : "") . (keys(%{$_->{key_ids}}) && " + key-ids: " . join(',', keys(%{$_->{key_ids}}))) . ($dir =~ /removable:/ && " removable: /dev/cdrom") . " update" . " } |