diff options
author | Gustavo De Nardin <spuk@mandriva.org> | 2007-07-08 02:44:48 +0000 |
---|---|---|
committer | Gustavo De Nardin <spuk@mandriva.org> | 2007-07-08 02:44:48 +0000 |
commit | f72c5dcc567118c50611dd744241e246c7583e1e (patch) | |
tree | 3d30b9ce6f9803b95c56e9096328c1798bda7975 | |
parent | 45c001ad8e55ab0908076467d0e40157495dfbef (diff) | |
download | mga-youri-submit-f72c5dcc567118c50611dd744241e246c7583e1e.tar mga-youri-submit-f72c5dcc567118c50611dd744241e246c7583e1e.tar.gz mga-youri-submit-f72c5dcc567118c50611dd744241e246c7583e1e.tar.bz2 mga-youri-submit-f72c5dcc567118c50611dd744241e246c7583e1e.tar.xz mga-youri-submit-f72c5dcc567118c50611dd744241e246c7583e1e.zip |
- check for newer/current revisions in default section when submitted to another section (bug #30635)
-rw-r--r-- | lib/Youri/Submit/Check/Recency.pm | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/Youri/Submit/Check/Recency.pm b/lib/Youri/Submit/Check/Recency.pm index f8aa5b7..840e709 100644 --- a/lib/Youri/Submit/Check/Recency.pm +++ b/lib/Youri/Submit/Check/Recency.pm @@ -25,13 +25,31 @@ sub run { my @revisions = $repository->get_revisions($package, $target, $define, undef, sub { return $_[0]->compare($package) >= 0 }); if (@revisions) { + my $section = $repository->_get_section($package, $target, $define); push( @errors, - "Current or newer revision(s) already exists for $target: " . + "Current or newer revision(s) already exists in $section for $target: " . join(', ', @revisions) ); } + my $defined_section = $define->{section}; + + # if the user provided a section, check also in the default section + if ($defined_section) { + $define->{section} = undef; + my @default_revisions = $repository->get_revisions($package, $target, $define, undef, sub { return $_[0]->compare($package) >= 0 }); + if (@default_revisions) { + my $section = $repository->_get_section($package, $target, $define); + push( + @errors, + "Current or newer revision(s) already exists in $section for $target: " . + join(', ', @default_revisions) + ); + } + $define->{section} = $defined_section; + } + return @errors; } |