summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-11 16:47:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-11 16:47:10 +0000
commit394ae8f63f5b478b7de44f3bd357303d156d1c62 (patch)
treed124eddcbe96bd96839c4415b73310982bc314aa /urpm/media.pm
parent584e7e3db6cca674c460d6ae87449083d3b1054f (diff)
downloadurpmi-394ae8f63f5b478b7de44f3bd357303d156d1c62.tar
urpmi-394ae8f63f5b478b7de44f3bd357303d156d1c62.tar.gz
urpmi-394ae8f63f5b478b7de44f3bd357303d156d1c62.tar.bz2
urpmi-394ae8f63f5b478b7de44f3bd357303d156d1c62.tar.xz
urpmi-394ae8f63f5b478b7de44f3bd357303d156d1c62.zip
create _copy_media_info_file() out of _get_list_or_pubkey__local()
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index b85a13bf..4f975019 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -908,17 +908,26 @@ sub _ignore_medium_on_parse_error {
$medium->{ignore} = 1;
}
-sub _get_list_or_pubkey__local {
- my ($urpm, $medium, $name) = @_;
+sub _copy_media_info_file {
+ my ($urpm, $medium, $prefix, $suffix) = @_;
- my $path = _synthesis_dir($medium) . "/$name" . _synthesis_suffix($medium);
+ my $name = "$prefix$suffix";
+ my $path = _synthesis_dir($medium) . "/$prefix" . _synthesis_suffix($medium) . $suffix;
-e $path or $path = file_from_local_url($medium->{url}) . "/media_info/$name";
+
+ my $result_file = "$urpm->{cachedir}/partial/$name";
if (-e $path) {
$urpm->{log}(N("copying [%s] for medium \"%s\"...", $path, $medium->{name}));
- copy_and_own($path, "$urpm->{cachedir}/partial/$name")
+ copy_and_own($path, $result_file)
or $urpm->{error}(N("...copying failed")), return;
}
- 1;
+ -s $result_file && $result_file;
+}
+
+sub _get_list_or_pubkey__local {
+ my ($urpm, $medium, $name) = @_;
+
+ _copy_media_info_file($urpm, $medium, $name, '');
}
sub _download_list_or_pubkey {