summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-06-24 12:57:19 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-06-24 12:57:19 +0000
commit9e44fa13392197983dc413aba1097d8da287a006 (patch)
tree660f37c176cbb2523774b98f785d9997cfb8077f
parente56348bfb7ec9dbe40058ee8cd04366835984f7f (diff)
downloadurpmi-9e44fa13392197983dc413aba1097d8da287a006.tar
urpmi-9e44fa13392197983dc413aba1097d8da287a006.tar.gz
urpmi-9e44fa13392197983dc413aba1097d8da287a006.tar.bz2
urpmi-9e44fa13392197983dc413aba1097d8da287a006.tar.xz
urpmi-9e44fa13392197983dc413aba1097d8da287a006.zip
create statedir_media_info_basename() and use it
-rw-r--r--urpm/media.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 711986a5..fce615f0 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -303,12 +303,17 @@ sub _url_with_synthesis {
sub synthesis {
my ($medium) = @_;
- $medium->{name} && "synthesis.hdlist.$medium->{name}.cz";
+ statedir_media_info_basename($medium, 'synthesis.hdlist', '.cz');
+}
+
+sub statedir_media_info_basename {
+ my ($medium, $prefix, $suffix) = @_;
+ $medium->{name} && "$prefix.$medium->{name}$suffix";
}
sub statedir_media_info_file {
my ($urpm, $medium, $prefix, $suffix) = @_;
- $medium->{name} && "$urpm->{statedir}/$prefix.$medium->{name}$suffix";
+ $medium->{name} && "$urpm->{statedir}/" . statedir_media_info_basename($medium, $prefix, $suffix);
}
sub statedir_synthesis {
my ($urpm, $medium) = @_;
@@ -1711,7 +1716,7 @@ sub _any_media_info__or_download {
my $download_dir;
if (my $userdir = urpm::userdir($urpm)) {
- $f = "$userdir/$prefix.$medium->{name}$suffix";
+ $f = "$userdir/" . statedir_media_info_basename($medium, $prefix, $suffix);
-s $f and return $f;
$download_dir = "$userdir/partial";