diff options
author | Florent Villard <warly@mandriva.com> | 2006-10-17 16:04:49 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-10-17 16:04:49 +0000 |
commit | 1dc5e5210b35dcce9f36c315fa7170ef874c27e3 (patch) | |
tree | 185b0b7ce17ef9ae97f6c2a0b77cc6406c0edb32 /lib/Youri/Submit/Check/Version.pm | |
parent | 36dc49a0fee40e68284ac1422255787fb740fee3 (diff) | |
download | mga-youri-submit-1dc5e5210b35dcce9f36c315fa7170ef874c27e3.tar mga-youri-submit-1dc5e5210b35dcce9f36c315fa7170ef874c27e3.tar.gz mga-youri-submit-1dc5e5210b35dcce9f36c315fa7170ef874c27e3.tar.bz2 mga-youri-submit-1dc5e5210b35dcce9f36c315fa7170ef874c27e3.tar.xz mga-youri-submit-1dc5e5210b35dcce9f36c315fa7170ef874c27e3.zip |
now checks must return the error message
Diffstat (limited to 'lib/Youri/Submit/Check/Version.pm')
-rw-r--r-- | lib/Youri/Submit/Check/Version.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/Youri/Submit/Check/Version.pm b/lib/Youri/Submit/Check/Version.pm index a66b14f..2d3d268 100644 --- a/lib/Youri/Submit/Check/Version.pm +++ b/lib/Youri/Submit/Check/Version.pm @@ -33,18 +33,17 @@ sub run { my ($self, $package, $repository, $target, $define) = @_; croak "Not a class method" unless ref $self; my $opt = $self->{$target}; - return 1 if $opt->{mode} eq 'normal'; + return if $opt->{mode} eq 'normal'; my $section = $repository->_get_section($package, $target, $define); my $name = $package->get_canonical_name; - return 1 if $name =~ /$opt->{authorized_packages}/; + return if $name =~ /$opt->{authorized_packages}/; my $arch = $repository->get_arch($package, $target, $define); - return 1 if $arch =~ /$opt->{authorized_arches}/; + return if $arch =~ /$opt->{authorized_arches}/; if ($opt->{mode} eq 'version_freeze') { - return 1 if $section =~ /$opt->{authorized_sections}/ + return if $section =~ /$opt->{authorized_sections}/ } elsif ($opt->{mode} eq 'freeze') { if ($section !~ /$opt->{authorized_sections}/) { - $self->{_error} = "FREEZE: repository $target section $section is frozen, you can still submit your packages in testing\nTo do so use your.devel --define section=<section> $target <package 1> <package 2> ... <package n>"; - return 0 + return "FREEZE: repository $target section $section is frozen, you can still submit your packages in testing\nTo do so use your.devel --define section=<section> $target <package 1> <package 2> ... <package n>"; } } my $source = $package->get_source_package; @@ -53,10 +52,8 @@ sub run { my @revisions = $repository->get_revisions($package, $target, $define, sub { my $source_package = $_[0]->get_source_package; my ($version) = $source_package =~ /-([^-]+)-[^-]+\.src\.rpm$/; print STDERR "Found version $version\n"; URPM::ranges_overlap("== $version", "< $package_version") }); $define->{arch} = ''; if (@revisions) { - $self->{_error} = "VERSION FREEZE, package @revisions of different versions exist in cooker\n"; - return 0 + return "VERSION FREEZE, package @revisions of different versions exist in cooker\n"; } - return 1 } =head1 COPYRIGHT AND LICENSE |