aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo De Nardin <spuk@mandriva.org>2007-06-23 08:10:53 +0000
committerGustavo De Nardin <spuk@mandriva.org>2007-06-23 08:10:53 +0000
commit7a9816909da6ea69827b81524bb904f1524258ff (patch)
treed371b8485f78671c6fe2b3467ac7af3fb4d1ecaa
parent61dcdce6ba83d727838861f4a4379865411f6f20 (diff)
downloadmga-youri-submit-7a9816909da6ea69827b81524bb904f1524258ff.tar
mga-youri-submit-7a9816909da6ea69827b81524bb904f1524258ff.tar.gz
mga-youri-submit-7a9816909da6ea69827b81524bb904f1524258ff.tar.bz2
mga-youri-submit-7a9816909da6ea69827b81524bb904f1524258ff.tar.xz
mga-youri-submit-7a9816909da6ea69827b81524bb904f1524258ff.zip
- check for newer and same existing revisions in a single pass
- use proper get_revisions() instead of get_install_file() hack, as the latter will use the current file name, and thus will fail to check for an existing package revision when submitting, because submitted SRPMs have a different name ("@rev:foobar-...") than what goes into the repository
-rw-r--r--lib/Youri/Submit/Check/Recency.pm17
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)
);
}