summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-08-22 00:50:26 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-08-22 00:50:26 +0000
commit09951ebbf3f2823e26511b5828a9630f941813fe (patch)
tree37601d1856e6165a141ce8b4a086d74b3c4fc265 /lib
parentf54fb53b07ecaced9bfbe450c6b2dc982a6d9fb7 (diff)
downloadperl-MDV-Distribconf-09951ebbf3f2823e26511b5828a9630f941813fe.tar
perl-MDV-Distribconf-09951ebbf3f2823e26511b5828a9630f941813fe.tar.gz
perl-MDV-Distribconf-09951ebbf3f2823e26511b5828a9630f941813fe.tar.bz2
perl-MDV-Distribconf-09951ebbf3f2823e26511b5828a9630f941813fe.tar.xz
perl-MDV-Distribconf-09951ebbf3f2823e26511b5828a9630f941813fe.zip
- add MD5SUM as supported value
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Distribconf.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index 87f33c3..6eb5fb5 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -221,9 +221,11 @@ sub loadtree {
if (-d "$distrib->{root}/media/media_info") {
$distrib->{infodir} = "media/media_info";
$distrib->{mediadir} = "media";
+ $distrib->{mediainfodir} = '/media_info';
} elsif (-d "$distrib->{root}/Mandrake/base") {
$distrib->{infodir} = "Mandrake/base";
$distrib->{mediadir} = "Mandrake";
+ $distrib->{mediainfodir} = '';
} else {
return 0;
}
@@ -271,9 +273,11 @@ sub settree {
} elsif ($spec && $spec =~ /mandrake/i) {
$distrib->{infodir} = "Mandrake/base";
$distrib->{mediadir} = "Mandrake";
+ $distrib->{mediainfodir} = '';
} else { # finally it can be everything, we do not care
$distrib->{infodir} = "media/media_info";
$distrib->{mediadir} = "media";
+ $distrib->{mediainfodir} = '/media_info';
}
}
@@ -438,6 +442,7 @@ sub getvalue {
return $distrib->{cfg}->val('media_info', 'mediacfg_version') || 1;
/^VERSION$/ and do { $default = 'VERSION'; last };
/^product$/ and do { $default = 'Download'; last };
+ /^MD5SUM$/ and do { $default = 'MD5SUM'; last };
/^(?:tag|branch)$/ and do { $default = ''; last };
/^(?:media|info)dir$/ and do { $default = $distrib->{$var}; last };
}
@@ -468,6 +473,19 @@ sub getpath {
}
}
+sub getmediapath {
+ my ($distrib, $media, $var) = @_;
+ my %files = (
+ pubkey => 'pubkey',
+ hdlist => 'hdlist.cz',
+ synthesis => 'synthesis.hdlist.cz',
+ MD5SUM => 'MD5SUM',
+ infodir => '',
+ );
+ $var eq 'path' and return $distrib->getpath($media, 'path');
+ return $distrib->getpath($media, 'path') . $distrib->{mediainfodir} . "/$files{$var}";
+}
+
=head2 $distrib->getfullpath($media, $var)
Does the same thing than getpath(), but the return value will be
@@ -483,6 +501,13 @@ sub getfullpath {
return $distrib->getpath(undef, 'root') . '/' . $path;
}
+sub getfullmediapath {
+ my $distrib = shift;
+ my $path = $distrib->getmediapath(@_) or return;
+ return $distrib->getpath(undef, 'root') . '/' . $path;
+}
+
+
1;
__END__