summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/media.pm16
1 files changed, 7 insertions, 9 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 3a21a0aa..46cd959a 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1516,8 +1516,9 @@ sub _get_pubkey {
$urpm->{modified} = 1;
}
+# options: wait_lock, nopubkey, forcekey
sub _get_pubkey_and_descriptions {
- my ($urpm, $medium, $nopubkey, $b_wait_lock) = @_;
+ my ($urpm, $medium, %options) = @_;
my $local = file_from_local_medium($medium);
@@ -1526,7 +1527,7 @@ sub _get_pubkey_and_descriptions {
($local ? \&get_descriptions_local : \&get_descriptions_remote)->($urpm, $medium);
}
- _get_pubkey($urpm, $medium, $b_wait_lock) if !$nopubkey && !$medium->{'key-ids'};
+ _get_pubkey($urpm, $medium, $options{wait_lock}) if !$options{nopubkey} && (!$medium->{'key-ids'} || $options{forcekey});
}
sub _read_cachedir_pubkey {
@@ -1576,12 +1577,9 @@ sub _update_medium_ {
? _update_medium__parse_if_unmodified__local($urpm, $medium, \%options)
: _update_medium__parse_if_unmodified__remote($urpm, $medium, \%options);
- if ($options{forcekey}) {
- delete $medium->{'key-ids'};
- if ($rc eq 'unmodified') {
- _get_pubkey($urpm, $medium); # we must do it now, quite hackish...
- return 1;
- }
+ if ($options{forcekey} && $rc eq 'unmodified') {
+ _get_pubkey($urpm, $medium); # we must do it now, quite hackish...
+ return 1;
}
if (!$rc || $rc eq 'unmodified') {
@@ -1623,7 +1621,7 @@ sub _update_medium_ {
# generated on first _parse_media()
unlink statedir_names($urpm, $medium);
- _get_pubkey_and_descriptions($urpm, $medium, $options{nopubkey}, $options{wait_lock});
+ _get_pubkey_and_descriptions($urpm, $medium, %options);
$is_updating and $urpm->{info}(N("updated medium \"%s\"", $medium->{name}));