summaryrefslogtreecommitdiffstats
path: root/lib/MDV
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-08-24 16:24:02 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-08-24 16:24:02 +0000
commitf52ea2a3f61a717fb0e7633fa96095d13f9b1c11 (patch)
treeb0588734dbdc8ccced66ee28d590bdb85172b037 /lib/MDV
parent777734a4e9a09290000d476d0c99f2a4a38b1d5f (diff)
downloadperl-MDV-Distribconf-f52ea2a3f61a717fb0e7633fa96095d13f9b1c11.tar
perl-MDV-Distribconf-f52ea2a3f61a717fb0e7633fa96095d13f9b1c11.tar.gz
perl-MDV-Distribconf-f52ea2a3f61a717fb0e7633fa96095d13f9b1c11.tar.bz2
perl-MDV-Distribconf-f52ea2a3f61a717fb0e7633fa96095d13f9b1c11.tar.xz
perl-MDV-Distribconf-f52ea2a3f61a717fb0e7633fa96095d13f9b1c11.zip
- fix VERSION for CPAN
Diffstat (limited to 'lib/MDV')
-rw-r--r--lib/MDV/Distribconf/Build.pm81
1 files changed, 2 insertions, 79 deletions
diff --git a/lib/MDV/Distribconf/Build.pm b/lib/MDV/Distribconf/Build.pm
index 129c467..44a1ecb 100644
--- a/lib/MDV/Distribconf/Build.pm
+++ b/lib/MDV/Distribconf/Build.pm
@@ -1,23 +1,3 @@
-##- Nanar <nanardon@mandriva.org>
-##- (c) 2005 Olivier Thauvin
-##- (c) 2005 Mandriva Linux
-##-
-##- This program is free software; you can redistribute it and/or modify
-##- it under the terms of the GNU General Public License as published by
-##- the Free Software Foundation; either version 2, or (at your option)
-##- any later version.
-##-
-##- This program is distributed in the hope that it will be useful,
-##- but WITHOUT ANY WARRANTY; without even the implied warranty of
-##- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-##- GNU General Public License for more details.
-##-
-##- You should have received a copy of the GNU General Public License
-##- along with this program; if not, write to the Free Software
-##- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# $Id$
-
package MDV::Distribconf::Build;
=head1 NAME
@@ -34,8 +14,8 @@ use strict;
use warnings;
use MDV::Distribconf;
-our @ISA = qw(MDV::Distribconf);
-our $VERSION = $MDV::Distribconf::VERSION;
+use base qw(MDV::Distribconf MDV::Distribconf::Checks);
+our $VERSION = (qq$Revision$ =~ /(\d+)/)[0];
=item MDV::Distribconf::Build->new($root_of_distrib)
@@ -168,63 +148,6 @@ sub write_version {
}
-=item $distrib->check($fhout)
-
-Performs basic checks on the distribution and prints to $fhout (STDERR by
-default) warnings and errors found. Returns the number of errors reported.
-
-=cut
-
-sub check {
- my ($distrib, $fhout) = @_;
- $fhout ||= \*STDERR;
-
- my $error = 0;
-
- my $report_err = sub {
- my ($l, $f, @msg) = @_;
- $l eq 'E' and $error++;
- printf $fhout "$l: $f\n", @msg;
- };
-
- $distrib->listmedia or $report_err->('W', "No media found in this config");
-
- # Checking no overlap
- foreach my $var (qw/hdlist synthesis path/) {
- my %e;
- foreach ($distrib->listmedia) {
- my $v = $distrib->getpath($_, $var);
- push @{$e{$v}}, $_;
- }
-
- foreach my $key (keys %e) {
- if (@{$e{$key}} > 1) {
- $report_err->('E', "media %s have same %s (%s)",
- join (", ", @{$e{$key}}),
- $var,
- $key
- );
- }
- }
- }
-
- foreach my $media ($distrib->listmedia) {
- -d $distrib->getfullpath($media, 'path') or $report_err->(
- 'E', "dir %s does't exist for media '%s'",
- $distrib->getpath($media, 'path'),
- $media
- );
- foreach (qw/hdlist synthesis pubkey/) {
- -f $distrib->getfullpath($media, $_) or $report_err->(
- 'E', "$_ %s doesn't exist for media '%s'",
- $distrib->getpath($media, $_),
- $media
- );
- }
- }
- return $error;
-}
-
1;
__END__