summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-11 16:49:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-11 16:49:14 +0000
commit8d2124bcbfd6f1d206035c95b2c88054bfae8612 (patch)
tree2ed2d5a3feb63499dd7de127fbb724fd43b0769b /urpm
parent394ae8f63f5b478b7de44f3bd357303d156d1c62 (diff)
downloadurpmi-8d2124bcbfd6f1d206035c95b2c88054bfae8612.tar
urpmi-8d2124bcbfd6f1d206035c95b2c88054bfae8612.tar.gz
urpmi-8d2124bcbfd6f1d206035c95b2c88054bfae8612.tar.bz2
urpmi-8d2124bcbfd6f1d206035c95b2c88054bfae8612.tar.xz
urpmi-8d2124bcbfd6f1d206035c95b2c88054bfae8612.zip
factorize code with statedir_media_info_file()
Diffstat (limited to 'urpm')
-rw-r--r--urpm/media.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 4f975019..7b570542 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -243,17 +243,21 @@ sub statedir_synthesis {
my ($urpm, $medium) = @_;
"$urpm->{statedir}/" . _synthesis($medium);
}
+sub statedir_media_info_file {
+ my ($urpm, $medium, $prefix, $suffix) = @_;
+ $medium->{name} && "$urpm->{statedir}/$prefix.$medium->{name}$suffix";
+}
sub statedir_descriptions {
my ($urpm, $medium) = @_;
- $medium->{name} && "$urpm->{statedir}/descriptions.$medium->{name}";
+ statedir_media_info_file($urpm, $medium, 'descriptions', '');
}
sub statedir_names {
my ($urpm, $medium) = @_;
- $medium->{name} && "$urpm->{statedir}/names.$medium->{name}";
+ statedir_media_info_file($urpm, $medium, 'names', '');
}
sub statedir_MD5SUM {
my ($urpm, $medium) = @_;
- $medium->{name} && "$urpm->{statedir}/MD5SUM.$medium->{name}";
+ statedir_media_info_file($urpm, $medium, 'MD5SUM', '');
}
sub cachedir_with_synthesis {
my ($urpm, $medium) = @_;