diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-12-10 15:11:30 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-12-10 15:11:30 +0000 |
commit | 474f4312f92d60973916d1e9be6450da55c4864b (patch) | |
tree | 26596afc2aa5931a875a1a3d8c263c9c3f6fed00 | |
parent | 2dccb90baa30f214a529a4b2598b6cdee3e53767 (diff) | |
download | urpmi-474f4312f92d60973916d1e9be6450da55c4864b.tar urpmi-474f4312f92d60973916d1e9be6450da55c4864b.tar.gz urpmi-474f4312f92d60973916d1e9be6450da55c4864b.tar.bz2 urpmi-474f4312f92d60973916d1e9be6450da55c4864b.tar.xz urpmi-474f4312f92d60973916d1e9be6450da55c4864b.zip |
- urpmi.addmedia:
o adapt to perl-URPM 2.11 API to parse pubkey files
(nb: $urpm->{keys} is not used anymore)
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | urpm/media.pm | 17 |
2 files changed, 8 insertions, 11 deletions
@@ -8,6 +8,8 @@ o exit code 1 when a medium can't be added o enhance parsing of urls with login:password for logins with "@" so that password doesn't end up in urpmi.cfg + o adapt to perl-URPM 2.11 API to parse pubkey files + (nb: $urpm->{keys} is not used anymore) Version 4.10.17 - 30 November 2007, by Pascal "Pixel" Rigaux diff --git a/urpm/media.pm b/urpm/media.pm index e2cca5e2..5a058803 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -1541,17 +1541,18 @@ sub _read_cachedir_pubkey { $urpm->{log}(N("examining pubkey file of \"%s\"...", $medium->{name})); my $_rpm_lock = urpm::lock::rpm_db($urpm, 'exclusive', wait => $b_wait_lock); + my $db = urpm::db_open_or_die($urpm, $urpm->{root}, 'rw'); my %key_ids; - $urpm->import_needed_pubkeys( - [ $urpm->parse_armored_file("$urpm->{cachedir}/partial/pubkey") ], - root => $urpm->{root}, - callback => sub { - my (undef, undef, $_k, $id, $imported) = @_; + URPM::import_pubkeys($db, + "$urpm->{cachedir}/partial/pubkey", + sub { + my ($id, $imported) = @_; if ($id) { $key_ids{$id} = undef; $imported and $urpm->{log}(N("...imported key %s from pubkey file of \"%s\"", $id, $medium->{name})); + $imported or $urpm->{debug}("pubkey $id already imported") if $urpm->{debug}; } else { $urpm->{error}(N("unable to import pubkey file of \"%s\"", $medium->{name})); } @@ -1786,12 +1787,6 @@ sub update_media { $urpm->{media} or return; # verify that configuration has been read $options{nopubkey} ||= $urpm->{options}{nopubkey}; - if (!$options{nopubkey} && !$urpm->{keys}) { - #- get gpg-pubkey signature. - my $_rpm_lock = urpm::lock::rpm_db($urpm, '', wait => $options{wait_lock}); - $urpm->{log}(qq(getting "gpg-pubkey"s from rpmdb)); - $urpm->parse_pubkeys(root => $urpm->{root}); - } #- examine each medium to see if one of them needs to be updated. #- if this is the case and if not forced, try to use a pre-calculated |