diff options
-rw-r--r-- | lib/Youri/Submit/Check/Recency.pm | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/Youri/Submit/Check/Recency.pm b/lib/Youri/Submit/Check/Recency.pm index 40e34e8..f8aa5b7 100644 --- a/lib/Youri/Submit/Check/Recency.pm +++ b/lib/Youri/Submit/Check/Recency.pm @@ -23,21 +23,12 @@ sub run { my @errors; - my $file = $repository->get_install_file($package, $target, $define); - if (-f $file) { + my @revisions = $repository->get_revisions($package, $target, $define, undef, sub { return $_[0]->compare($package) >= 0 }); + if (@revisions) { push( @errors, - "Current revision already exists for $target" - ); - } - - my @newer_revisions = - $repository->get_newer_revisions($package, $target, $define); - if (@newer_revisions) { - push( - @errors, - "Newer revisions already exists for $target: " . - join(', ', @newer_revisions) + "Current or newer revision(s) already exists for $target: " . + join(', ', @revisions) ); } |