diff options
-rw-r--r-- | lib/Youri/Submit/Check/Version.pm | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/lib/Youri/Submit/Check/Version.pm b/lib/Youri/Submit/Check/Version.pm index 8cc50de..0035e7a 100644 --- a/lib/Youri/Submit/Check/Version.pm +++ b/lib/Youri/Submit/Check/Version.pm @@ -41,21 +41,36 @@ sub run { return if $arch =~ /$opt->{authorized_arches}/; if ($opt->{mode} eq 'version_freeze') { return if $section =~ /$opt->{authorized_sections}/ - } elsif ($opt->{mode} eq 'freeze') { + } + # FIXME: The following code is not working and must be reviewed. + elsif ($opt->{mode} eq 'freeze') { + # XXX: So freeze mode really only check for this exceptions? if ($section !~ /$opt->{authorized_sections}/) { - 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>"; - } - } else { - my $source = $package->get_source_package; - my ($package_version) = $source =~ /-([^-]+)-[^-]+\.src\.rpm$/; - $define->{arch} = 'src'; - 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) { - return "FREEZE, package @revisions of different versions exist in $target\n"; - } - } - return + 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>"; + } + } else { + # FIXME: Calls to get_source_package seems invalid nowadays. + # This results on $source having a null content. + my $source = $package->get_source_package; + my ($package_version) = $source =~ /-([^-]+)-[^-]+\.src\.rpm$/; + $define->{arch} = 'src'; + # FIXME: get_revisions now expects the filter as the 5th element, and not the 4th. + my @revisions = $repository->get_revisions($package, $target, $define, + sub { + # FIXME: Calls to get_source_package seems invalid nowadays. + # This results on $source_package having a null content. + 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) { + return "FREEZE, package @revisions of different versions exist in $target\n"; + } + } + return } =head1 COPYRIGHT AND LICENSE |