summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-08 14:18:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-08 14:18:16 +0000
commite2538a0316a95b8ef49c715023cd84c8e4b7a3b7 (patch)
treeeeec2fdb2acd4c8db442ca76fab6068a3cee0915 /urpm/media.pm
parent21c8ebddce1e8d6bd3122f2cc9d52d0abc346930 (diff)
downloadurpmi-e2538a0316a95b8ef49c715023cd84c8e4b7a3b7.tar
urpmi-e2538a0316a95b8ef49c715023cd84c8e4b7a3b7.tar.gz
urpmi-e2538a0316a95b8ef49c715023cd84c8e4b7a3b7.tar.bz2
urpmi-e2538a0316a95b8ef49c715023cd84c8e4b7a3b7.tar.xz
urpmi-e2538a0316a95b8ef49c715023cd84c8e4b7a3b7.zip
- rename _get_list_or_pubkey__remote() into _download_list_or_pubkey()
- create _download_media_info_file() out of _download_list_or_pubkey() for future use
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 87966dd1..81473f39 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -926,15 +926,22 @@ sub _get_list_or_pubkey__local {
1;
}
-sub _get_list_or_pubkey__remote {
+sub _download_list_or_pubkey {
my ($urpm, $medium, $name) = @_;
+ _download_media_info_file($urpm, $medium, $name, '', 1);
+}
+
+sub _download_media_info_file {
+ my ($urpm, $medium, $prefix, $suffix, $quiet) = @_;
+
+ my $name = "$prefix$suffix";
my $found;
if (_synthesis_suffix($medium)) {
- my $local_name = $name . _synthesis_suffix($medium);
+ my $local_name = $prefix . _synthesis_suffix($medium) . $suffix;
if (urpm::download::sync($urpm, $medium, [_synthesis_dir($medium) . "/$local_name"],
- quiet => 1)) {
+ quiet => $quiet)) {
rename("$urpm->{cachedir}/partial/$local_name", "$urpm->{cachedir}/partial/$name");
$found = 1;
}
@@ -1216,7 +1223,7 @@ sub _get_pubkey_and_descriptions {
#- 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');
+ ($local ? \&_get_list_or_pubkey__local : \&_download_list_or_pubkey)->($urpm, $medium, 'pubkey');
}
}