summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2008-01-16 23:04:43 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2008-01-16 23:04:43 +0000
commit178521d057638c8b04422fb8c832e002f0dddcfe (patch)
tree3ee7aad11c28593ec3ad31240045620a74e4b6cd /lib
parenta10837e75e1c04c36dcfc3167f5ce721f3658dc2 (diff)
downloadperl-MDV-Distribconf-178521d057638c8b04422fb8c832e002f0dddcfe.tar
perl-MDV-Distribconf-178521d057638c8b04422fb8c832e002f0dddcfe.tar.gz
perl-MDV-Distribconf-178521d057638c8b04422fb8c832e002f0dddcfe.tar.bz2
perl-MDV-Distribconf-178521d057638c8b04422fb8c832e002f0dddcfe.tar.xz
perl-MDV-Distribconf-178521d057638c8b04422fb8c832e002f0dddcfe.zip
- handle new xml files
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Distribconf.pm43
1 files changed, 34 insertions, 9 deletions
diff --git a/lib/MDV/Distribconf.pm b/lib/MDV/Distribconf.pm
index d8be727..a06bc3b 100644
--- a/lib/MDV/Distribconf.pm
+++ b/lib/MDV/Distribconf.pm
@@ -76,6 +76,18 @@ A human-readable name for the media. By default this is the media path
(that is, the section name), where slashes have been replaced by
underscores.
+=item B<info>
+
+The xml file containing rpm informations.
+
+=item B<changelog>
+
+The xml file containing rpm changelogs.
+
+=item B<files>
+
+The xml file containing rpm files list.
+
=back
=item global specific values:
@@ -437,7 +449,11 @@ sub getvalue {
my $default = "";
for ($var) {
- /^synthesis$/ and $default = 'synthesis.' . lc($distrib->getvalue($media, 'hdlist', $level));
+ /^path$/ and return $media;
+ /^root$/ and return $distrib->{root};
+ /^(info|files|changelog)$/ and
+ return "$var." . lc($distrib->getvalue($media, 'name', $level)) . '.xml.lzma';
+ /^synthesis$/ and $default = 'synthesis.' . lc($distrib->getvalue($media, 'hdlist', $level));
/^hdlist$/ and $default = 'hdlist_' . lc($distrib->getvalue($media, 'name', $level)) . '.cz';
/^pubkey$/ and $default = 'pubkey_' . lc($distrib->getvalue($media, 'name', $level));
/^(pubkey|hdlist|synthesis)$/ and do {
@@ -452,8 +468,6 @@ sub getvalue {
return join(',', map { "$_=" . ($distrib->getvalue(undef, $_) || '') }
qw(vendor distribution type version branch release arch product));
};
- /^path$/ and return $media;
- /^root$/ and return $distrib->{root};
/^mediacfg_version$/ and
return $distrib->{cfg}->val('media_info', 'mediacfg_version') || 1;
/^VERSION$/ and do { $default = 'VERSION'; last };
@@ -497,6 +511,10 @@ sub getpath {
my ($distrib, $media, $var) = @_;
$distrib->mediaexists($media) or return;
$var ||= ""; # Avoid undef value
+ if ($var =~ /^(info|files|changelog)$/) {
+ $distrib->getvalue($media, 'xml-info') or return;
+ $distrib->getvalue($media, 'cdmode') or return;
+ }
my $val = $distrib->getvalue($media, $var);
$var =~ /^(?:root|VERSION|product\.id|(?:media|info)dir)$/ and return $val;
my $thispath = $var eq 'path' ? $distrib->{mediadir} : $distrib->{infodir};
@@ -519,13 +537,20 @@ to the media for files having doble location (index for example).
sub getmediapath {
my ($distrib, $media, $var) = @_;
my %files = (
- pubkey => 'pubkey',
- hdlist => 'hdlist.cz',
- synthesis => 'synthesis.hdlist.cz',
- MD5SUM => 'MD5SUM',
- infodir => '',
+ pubkey => 'pubkey',
+ hdlist => 'hdlist.cz',
+ synthesis => 'synthesis.hdlist.cz',
+ MD5SUM => 'MD5SUM',
+ infodir => '',
+ info => 'info.xml.lzma',
+ files => 'files.xml.lzma',
+ changelog => 'changelog.xml.lzma',
);
$var eq 'path' and return $distrib->getpath($media, 'path');
+ if ($var =~ /^(info|files|changelog)$/) {
+ $distrib->getvalue($media, 'xml-info') or return;
+ $distrib->getvalue($media, 'cdmode') and return;
+ }
return $distrib->getpath($media, 'path') . $distrib->{mediainfodir} . "/$files{$var}";
}
@@ -570,7 +595,7 @@ You may want to use this function to ensure you allways the good value.
sub getdpath {
my ($distrib, $media, $var) = @_;
- if ($var =~ /^(hdlist|synthesis|pubkey|MD5SUM)$/) {
+ if ($var =~ /^(hdlist|synthesis|pubkey|MD5SUM|info|files|changelog)$/) {
if ($distrib->getvalue($media, 'cdmode')
|| $distrib->{type} eq 'mandrake') {
return $distrib->getpath($media, $var);