aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Leitner <mrl@mandriva.com>2007-03-15 12:32:11 +0000
committerMarcelo Leitner <mrl@mandriva.com>2007-03-15 12:32:11 +0000
commit6e019bb46e9067d63616992513dd3229e1c2552f (patch)
tree930962544a3fc2c23d566d560f7a570b0ea336d4
parent714610027f1b8ab655639af963303630fb7e1818 (diff)
downloadmga-youri-submit-6e019bb46e9067d63616992513dd3229e1c2552f.tar
mga-youri-submit-6e019bb46e9067d63616992513dd3229e1c2552f.tar.gz
mga-youri-submit-6e019bb46e9067d63616992513dd3229e1c2552f.tar.bz2
mga-youri-submit-6e019bb46e9067d63616992513dd3229e1c2552f.tar.xz
mga-youri-submit-6e019bb46e9067d63616992513dd3229e1c2552f.zip
- Improved indentation.
- Added some comments regarding possible bugs in freeze modes.
-rw-r--r--lib/Youri/Submit/Check/Version.pm43
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