diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-19 00:01:30 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2007-07-19 00:01:30 +0000 |
commit | 6a4ff7f67384ab5a9247baad448ced84932f9831 (patch) | |
tree | b31bf74e1abf52f3894f5213734dd336b1245029 /lib/MDV/Distribconf | |
parent | 1b7c93ad588a6c4d1d3f5bb4f166d51933043e27 (diff) | |
download | perl-MDV-Distribconf-6a4ff7f67384ab5a9247baad448ced84932f9831.tar perl-MDV-Distribconf-6a4ff7f67384ab5a9247baad448ced84932f9831.tar.gz perl-MDV-Distribconf-6a4ff7f67384ab5a9247baad448ced84932f9831.tar.bz2 perl-MDV-Distribconf-6a4ff7f67384ab5a9247baad448ced84932f9831.tar.xz perl-MDV-Distribconf-6a4ff7f67384ab5a9247baad448ced84932f9831.zip |
- report the offset of media in msg when checking rpms vs hdlist content
Diffstat (limited to 'lib/MDV/Distribconf')
-rw-r--r-- | lib/MDV/Distribconf/Checks.pm | 16 |
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 ); } |