summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-12-10 15:11:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-12-10 15:11:30 +0000
commit474f4312f92d60973916d1e9be6450da55c4864b (patch)
tree26596afc2aa5931a875a1a3d8c263c9c3f6fed00 /urpm/media.pm
parent2dccb90baa30f214a529a4b2598b6cdee3e53767 (diff)
downloadurpmi-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)
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm17
1 files changed, 6 insertions, 11 deletions
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