diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 12:13:34 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 12:13:34 +0000 |
commit | e4eabb750ba17ea9ac9d63e4bbff66c2f6605c2c (patch) | |
tree | 44a66feb9bbe3bab779f9bff43ae2572f9613552 | |
parent | 2516d9c1311cfa16fd8c183ba762fd84e6515a67 (diff) | |
download | urpmi-e4eabb750ba17ea9ac9d63e4bbff66c2f6605c2c.tar urpmi-e4eabb750ba17ea9ac9d63e4bbff66c2f6605c2c.tar.gz urpmi-e4eabb750ba17ea9ac9d63e4bbff66c2f6605c2c.tar.bz2 urpmi-e4eabb750ba17ea9ac9d63e4bbff66c2f6605c2c.tar.xz urpmi-e4eabb750ba17ea9ac9d63e4bbff66c2f6605c2c.zip |
create _get_pubkey_and_descriptions() out of various code that was done in the
middle of code parsing hdlist/synthesis
-rw-r--r-- | urpm.pm | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -1485,8 +1485,6 @@ this could happen if you mounted manually the directory when creating the medium _parse_hdlist_or_synthesis__virtual($urpm, $medium); } - get_descriptions_local($urpm, $medium); - #- examine if a distant MD5SUM file is available. #- this will only be done if $with_hdlist is not empty in order to use #- an existing hdlist or synthesis file, and to check if download was good. @@ -1539,11 +1537,6 @@ this could happen if you mounted manually the directory when creating the medium } } - #- examine if a local pubkey file is available. - if (!$options->{nopubkey} && !$medium->{'key-ids'}) { - _get_list_or_pubkey__local($urpm, $medium, 'pubkey'); - } - 1; } @@ -1552,8 +1545,6 @@ sub _update_medium__parse_if_unmodified__or_get_files__remote { my ($urpm, $medium, $options) = @_; my ($retrieved_md5sum, $basename); - get_descriptions_remote($urpm, $medium); - #- examine if a distant MD5SUM file is available. #- this will only be done if $with_hdlist is not empty in order to use #- an existing hdlist or synthesis file, and to check if download was good. @@ -1639,11 +1630,6 @@ sub _update_medium__parse_if_unmodified__or_get_files__remote { #- the files are different, update local copy. rename("$urpm->{cachedir}/partial/$basename", cachedir_hdlist($urpm, $medium)); - - #- retrieve pubkey file. - if (!$options->{nopubkey} && !$medium->{'key-ids'}) { - _get_list_or_pubkey__remote($urpm, $medium, 'pubkey'); - } } else { $options->{callback} and $options->{callback}('failed', $medium->{name}); $urpm->{error}(N("retrieval of source hdlist (or synthesis) failed")); @@ -1653,6 +1639,19 @@ sub _update_medium__parse_if_unmodified__or_get_files__remote { 1; } +sub _get_pubkey_and_descriptions { + my ($urpm, $medium, $nopubkey) = @_; + + my $local = file_from_local_url($medium->{url}); + + ($local ? \&get_descriptions_local : \&get_descriptions_remote)->($urpm, $medium); + + #- examine if a pubkey file is available. + if (!$nopubkey && !$medium->{'key-ids'}) { + ($local ? \&_get_list_or_pubkey__local : \&_get_list_or_pubkey__remote)->($urpm, $medium, 'pubkey'); + } +} + sub _read_cachedir_pubkey { my ($urpm, $medium) = @_; -s "$urpm->{cachedir}/partial/pubkey" or return; @@ -1781,6 +1780,8 @@ sub _update_medium_first_pass { } } + _get_pubkey_and_descriptions($urpm, $medium, $options{nopubkey}); + _read_cachedir_pubkey($urpm, $medium); unless ($medium->{virtual}) { |