summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm29
1 files changed, 15 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index e5a4096e..b288c6d2 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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}) {