aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Leitner <mrl@mandriva.com>2007-03-15 12:36:35 +0000
committerMarcelo Leitner <mrl@mandriva.com>2007-03-15 12:36:35 +0000
commit1fa06b624c0576b0b102fb4617ae15e8d993fb09 (patch)
tree9ec6d5bb8b1336d739c740063ed5c808f25cac0f
parent6e019bb46e9067d63616992513dd3229e1c2552f (diff)
downloadmga-youri-submit-1fa06b624c0576b0b102fb4617ae15e8d993fb09.tar
mga-youri-submit-1fa06b624c0576b0b102fb4617ae15e8d993fb09.tar.gz
mga-youri-submit-1fa06b624c0576b0b102fb4617ae15e8d993fb09.tar.bz2
mga-youri-submit-1fa06b624c0576b0b102fb4617ae15e8d993fb09.tar.xz
mga-youri-submit-1fa06b624c0576b0b102fb4617ae15e8d993fb09.zip
- Fixed version_freeze mode: do not allow any upload with a different version
from what is already present on the repository. - Added an ACL control for maintainers allowed to bypass this restriction as option authorized_users.
-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') {