summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MDV/Distribconf/Checks.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/MDV/Distribconf/Checks.pm b/lib/MDV/Distribconf/Checks.pm
index 57bae02..f1c70ba 100644
--- a/lib/MDV/Distribconf/Checks.pm
+++ b/lib/MDV/Distribconf/Checks.pm
@@ -235,8 +235,11 @@ Return 1 if no problem were found
=cut
-
sub check_index_sync {
+ return (get_index_sync_offset(@_))[0]
+}
+
+sub get_index_sync_offset {
my ($self, $media, $submedia) = @_;
my $rpmspath = $self->getfullpath($media, 'path');
my $hdlist = ($submedia && -d $self->getfullpath($media, 'path') . '/media_info') ?
@@ -249,9 +252,9 @@ sub check_index_sync {
-f $hdlist && -f $synthesis or return 0; # avoid warnings
my ($inp, $ind) = MDV::Distribconf::Utils::hdlist_vs_dir($hdlist, $rpmspath);
if (@{$inp || []} + @{$ind || []}) {
- return 0;
+ return (0, scalar(@{$inp || []}), scalar(@{$ind || []}));
}
- return 1;
+ return (1, 0, 0);
}
=item $distrib->check_media_md5($media)
@@ -312,12 +315,13 @@ sub checkdistrib {
$error += $self->check_media_coherency($fhout);
foreach my $media ($self->listmedia) {
- if(!$self->check_index_sync($media)) {
+ my ($e, $inhd, $indir) = $self->get_index_sync_offset($media);
+ if (!$e) {
$error += _report_err(
$fhout,
'UNSYNC_HDLIST',
- "hdlist for media `%s' is not sync with its rpms",
- $media,
+ "hdlist for media `%s' is not sync with its rpms (+%d -%d rpms)",
+ $media, $indir, $inhd
);
}