diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-10-20 09:03:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-10-20 09:03:20 +0000 |
commit | e22a7e6f6d267b8d7cf2c6c188cdcbd7d703a49a (patch) | |
tree | aad62ec5f00b4561edeea0588194efb7ee8ad943 /urpm/media.pm | |
parent | 709f56043b97de033cbb83f21ef27e64d91a480b (diff) | |
download | urpmi-e22a7e6f6d267b8d7cf2c6c188cdcbd7d703a49a.tar urpmi-e22a7e6f6d267b8d7cf2c6c188cdcbd7d703a49a.tar.gz urpmi-e22a7e6f6d267b8d7cf2c6c188cdcbd7d703a49a.tar.bz2 urpmi-e22a7e6f6d267b8d7cf2c6c188cdcbd7d703a49a.tar.xz urpmi-e22a7e6f6d267b8d7cf2c6c188cdcbd7d703a49a.zip |
make things more clear: do not "delete $medium->{key-ids}" to ensure we don't
loose key-ids for media we don't update (??)
Diffstat (limited to 'urpm/media.pm')
-rw-r--r-- | urpm/media.pm | 16 |
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})); |