aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Youri/Submit/Check/Version.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Youri/Submit/Check/Version.pm b/lib/Youri/Submit/Check/Version.pm
index 0035e7a..289ffe0 100644
--- a/lib/Youri/Submit/Check/Version.pm
+++ b/lib/Youri/Submit/Check/Version.pm
@@ -40,7 +40,21 @@ sub run {
my $arch = $repository->get_arch($package, $target, $define);
return if $arch =~ /$opt->{authorized_arches}/;
if ($opt->{mode} eq 'version_freeze') {
- return if $section =~ /$opt->{authorized_sections}/
+ return if $section =~ /$opt->{authorized_sections}/;
+ my $user = $define->{user};
+ return if $user =~ /$opt->{authorized_users}/;
+ my ($package_version) = $package =~ /-([^-]+)-[^-]+\.src$/;
+ $define->{arch} = 'src';
+ my @revisions = $repository->get_revisions($package, $target, $define, undef,
+ sub {
+ my ($version) = $_[0] =~ /-([^-]+)-[^-]+\.src$/;
+ URPM::ranges_overlap("== $version", "< $package_version")
+ }
+ );
+ $define->{arch} = '';
+ if (@revisions) {
+ return "FREEZE, package @revisions of different versions exist in $target\n";
+ }
}
# FIXME: The following code is not working and must be reviewed.
elsif ($opt->{mode} eq 'freeze') {