summaryrefslogtreecommitdiffstats
path: root/lib/MDV
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2008-01-17 17:50:50 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2008-01-17 17:50:50 +0000
commit9cedd9938ed1afaf9469ff817db9fa78e6de3302 (patch)
treede0235fb8965e47b6908a371a27a6a8b83c8e785 /lib/MDV
parent8f662ac750a4796e4d0efa2240d72ce3a1019b1c (diff)
downloadperl-MDV-Distribconf-9cedd9938ed1afaf9469ff817db9fa78e6de3302.tar
perl-MDV-Distribconf-9cedd9938ed1afaf9469ff817db9fa78e6de3302.tar.gz
perl-MDV-Distribconf-9cedd9938ed1afaf9469ff817db9fa78e6de3302.tar.bz2
perl-MDV-Distribconf-9cedd9938ed1afaf9469ff817db9fa78e6de3302.tar.xz
perl-MDV-Distribconf-9cedd9938ed1afaf9469ff817db9fa78e6de3302.zip
- perform basic check on new xml files
Diffstat (limited to 'lib/MDV')
-rw-r--r--lib/MDV/Distribconf/Checks.pm29
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/MDV/Distribconf/Checks.pm b/lib/MDV/Distribconf/Checks.pm
index 078cda9..ac0b643 100644
--- a/lib/MDV/Distribconf/Checks.pm
+++ b/lib/MDV/Distribconf/Checks.pm
@@ -217,6 +217,16 @@ sub check_media_coherency {
$media
);
}
+ if ($distrib->getvalue($media, 'xml-info')) {
+ foreach (qw/info files changelog/) {
+ -f $distrib->getfulldpath($media, $_) or $error += _report_err(
+ $fhout,
+ 'MISSING_INDEX', "$_ %s doesn't exist for media `%s'",
+ $distrib->getfulldpath($media, $_),
+ $media
+ );
+ }
+ }
foreach (qw/pubkey/) {
-f $distrib->getfullpath($media, $_) or $error += _report_err(
$fhout,
@@ -277,9 +287,14 @@ Return 1 if no error were found.
sub check_media_md5 {
my ($self, $media) = @_;
+ my @indexes = map { $self->getfullmediapath($media, $_) } (qw(hdlist synthesis));
+ if ($self->getvalue($media, 'xml-info') && !$self->getvalue($media, 'cdmode')) {
+ push(@indexes, map { $self->getfullmediapath($media, $_) }
+ (qw(info files changelog)));
+ }
my ($unsync) = MDV::Distribconf::Utils::checkmd5(
$self->getfullmediapath($media, 'MD5SUM'),
- map { $self->getfullmediapath($media, $_) } (qw(hdlist synthesis))
+ @indexes
);
if (@{$unsync || []}) {
return 0;
@@ -292,8 +307,18 @@ sub check_global_md5 {
my ($self) = @_;
my @indexes;
foreach my $media ($self->listmedia()) {
- push(@indexes, map { $self->getfullpath($media, $_) } (qw(hdlist synthesis)));
+ push(
+ @indexes,
+ map { $self->getfulldpath($media, $_) } (qw(hdlist synthesis))
+ );
+ if ($self->getvalue($media, 'xml-info') && $self->getvalue($media, 'cdmode')) {
+ push(
+ @indexes,
+ map { $self->getfulldpath($media, $_) } (qw(info files changelog))
+ );
+ }
}
+
my ($unsync) = MDV::Distribconf::Utils::checkmd5(
$self->getfullpath(undef, 'MD5SUM'),
@indexes,