From f5486901b3c1947971af3f1e7fd56000b39e778e Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 20 Oct 2008 09:07:11 +0000 Subject: cleanup: split _get_pubkey_and_descriptions() into _get_descriptions() and _may_get_pubkey() --- urpm/media.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'urpm/media.pm') diff --git a/urpm/media.pm b/urpm/media.pm index c7576787..d0291b8e 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -1516,9 +1516,8 @@ sub _get_pubkey { $urpm->{modified} = 1; } -# options: wait_lock, nopubkey, forcekey -sub _get_pubkey_and_descriptions { - my ($urpm, $medium, %options) = @_; +sub _get_descriptions { + my ($urpm, $medium) = @_; my $local = file_from_local_medium($medium); @@ -1526,7 +1525,12 @@ sub _get_pubkey_and_descriptions { if ($medium->{update}) { ($local ? \&get_descriptions_local : \&get_descriptions_remote)->($urpm, $medium); } +} +# options: wait_lock, nopubkey, forcekey +sub _may_get_pubkey { + my ($urpm, $medium, %options) = @_; + _get_pubkey($urpm, $medium, $options{wait_lock}) if !$options{nopubkey} && (!$medium->{'key-ids'} || $options{forcekey}); } @@ -1621,7 +1625,8 @@ sub _update_medium_ { # generated on first _parse_media() unlink statedir_names($urpm, $medium); - _get_pubkey_and_descriptions($urpm, $medium, %options); + _get_descriptions($urpm, $medium); + _may_get_pubkey($urpm, $medium, %options); $is_updating and $urpm->{info}(N("updated medium \"%s\"", $medium->{name})); -- cgit v1.2.1