diff options
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 |