From 0d92b3daf96cdda22f865aa9f5820e3a4df6f162 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 4 Apr 2011 23:55:35 +0000 Subject: use mga-youri-submit (and rename files accordingly) --- modules/buildsystem/files/Mageia.pm | 2 +- modules/buildsystem/manifests/init.pp | 10 +++--- modules/buildsystem/templates/mdv-youri-submit | 2 -- .../buildsystem/templates/mdv-youri-submit.wrapper | 36 ---------------------- modules/buildsystem/templates/mga-youri-submit | 2 ++ .../buildsystem/templates/mga-youri-submit.wrapper | 36 ++++++++++++++++++++++ modules/buildsystem/templates/repsys.conf | 2 +- modules/buildsystem/templates/sudoers.youri | 2 +- 8 files changed, 46 insertions(+), 46 deletions(-) delete mode 100755 modules/buildsystem/templates/mdv-youri-submit delete mode 100755 modules/buildsystem/templates/mdv-youri-submit.wrapper create mode 100755 modules/buildsystem/templates/mga-youri-submit create mode 100755 modules/buildsystem/templates/mga-youri-submit.wrapper diff --git a/modules/buildsystem/files/Mageia.pm b/modules/buildsystem/files/Mageia.pm index ce4ed478..109aeb29 100644 --- a/modules/buildsystem/files/Mageia.pm +++ b/modules/buildsystem/files/Mageia.pm @@ -415,7 +415,7 @@ sub _get_section { if (!$section) { # debug packages should be found by previous specific version search # NOTE: as above, should/need we search here and add the 'debug_' prefix? - # ... probably... as at least mdv-youri-submit-force will process debug packages + # ... probably... as at least mga-youri-submit-force will process debug packages if ($package->is_debug() && $self->{_verbose}) { print "Warning: debug package $name with version $version-$release not found.\n"; } diff --git a/modules/buildsystem/manifests/init.pp b/modules/buildsystem/manifests/init.pp index d930d6da..2eabd190 100644 --- a/modules/buildsystem/manifests/init.pp +++ b/modules/buildsystem/manifests/init.pp @@ -202,21 +202,21 @@ class buildsystem { class youri_submit { include sudo - file { "/usr/local/bin/mdv-youri-submit": + file { "/usr/local/bin/mga-youri-submit": owner => root, group => root, mode => 755, - content => template("buildsystem/mdv-youri-submit") + content => template("buildsystem/mga-youri-submit") } - file { "/usr/local/bin/mdv-youri-submit.wrapper": + file { "/usr/local/bin/mga-youri-submit.wrapper": owner => root, group => root, mode => 755, - content => template("buildsystem/mdv-youri-submit.wrapper") + content => template("buildsystem/mga-youri-submit.wrapper") } - sudo::sudoers_config { "mdv-youri-submit": + sudo::sudoers_config { "mga-youri-submit": content => template("buildsystem/sudoers.youri") } diff --git a/modules/buildsystem/templates/mdv-youri-submit b/modules/buildsystem/templates/mdv-youri-submit deleted file mode 100755 index 93cc1c1e..00000000 --- a/modules/buildsystem/templates/mdv-youri-submit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec sudo /usr/local/bin/mdv-youri-submit.wrapper "$@" diff --git a/modules/buildsystem/templates/mdv-youri-submit.wrapper b/modules/buildsystem/templates/mdv-youri-submit.wrapper deleted file mode 100755 index f20e3412..00000000 --- a/modules/buildsystem/templates/mdv-youri-submit.wrapper +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl -# youri-submit wrapper - -use strict; -use warnings; -use Fcntl ':mode'; -use File::Basename; -use MDK::Common; - -my $log_dir = "$ENV{HOME}/submit-logs"; - -my $sudo_user = $ENV{SUDO_USER} or die "should be run through sudo"; -my @prog = ('perl', '-I/usr/share/mdv-youri-submit/lib', '/usr/share/mdv-youri-submit/bin/youri-submit'); - -my @options; -foreach my $arg (@ARGV) { - if ($arg =~ /^-?-(\S+)/) { - # drop prohibited options - if ($arg =~ /-c/ || $arg =~ /-s/) { - print STDERR "prohibited option $arg, skipping\n"; - next; - } - } - push(@options, $arg); -} - -# logging for bug #30315 -spuk, 2007-05-29 -mkdir_p($log_dir); -open(STDERR, "| tee -a $log_dir/$sudo_user.err >&2"); -open(STDOUT, "| tee -a $log_dir/$sudo_user.out"); - -# call wrapped program -print "Executing @prog --config /etc/youri/submit-todo.conf --define user=$sudo_user @options (sudo_user $sudo_user)\n"; -my $err = system(@prog, "--config", "/etc/youri/submit-todo.conf", "--define", "user=$sudo_user", @options) && ($? >> 8 || 1); - -exit $err diff --git a/modules/buildsystem/templates/mga-youri-submit b/modules/buildsystem/templates/mga-youri-submit new file mode 100755 index 00000000..0d29d462 --- /dev/null +++ b/modules/buildsystem/templates/mga-youri-submit @@ -0,0 +1,2 @@ +#!/bin/sh +exec sudo /usr/local/bin/mga-youri-submit.wrapper "$@" diff --git a/modules/buildsystem/templates/mga-youri-submit.wrapper b/modules/buildsystem/templates/mga-youri-submit.wrapper new file mode 100755 index 00000000..66fc59bc --- /dev/null +++ b/modules/buildsystem/templates/mga-youri-submit.wrapper @@ -0,0 +1,36 @@ +#!/usr/bin/perl +# youri-submit wrapper + +use strict; +use warnings; +use Fcntl ':mode'; +use File::Basename; +use MDK::Common; + +my $log_dir = "$ENV{HOME}/submit-logs"; + +my $sudo_user = $ENV{SUDO_USER} or die "should be run through sudo"; +my @prog = ('perl', '-I/usr/share/mga-youri-submit/lib', '/usr/share/mga-youri-submit/bin/youri-submit'); + +my @options; +foreach my $arg (@ARGV) { + if ($arg =~ /^-?-(\S+)/) { + # drop prohibited options + if ($arg =~ /-c/ || $arg =~ /-s/) { + print STDERR "prohibited option $arg, skipping\n"; + next; + } + } + push(@options, $arg); +} + +# logging for bug #30315 -spuk, 2007-05-29 +mkdir_p($log_dir); +open(STDERR, "| tee -a $log_dir/$sudo_user.err >&2"); +open(STDOUT, "| tee -a $log_dir/$sudo_user.out"); + +# call wrapped program +print "Executing @prog --config /etc/youri/submit-todo.conf --define user=$sudo_user @options (sudo_user $sudo_user)\n"; +my $err = system(@prog, "--config", "/etc/youri/submit-todo.conf", "--define", "user=$sudo_user", @options) && ($? >> 8 || 1); + +exit $err diff --git a/modules/buildsystem/templates/repsys.conf b/modules/buildsystem/templates/repsys.conf index 1e95ca72..72cea909 100644 --- a/modules/buildsystem/templates/repsys.conf +++ b/modules/buildsystem/templates/repsys.conf @@ -59,7 +59,7 @@ mageia_branch = cauldron [helper] create-srpm = /usr/share/repsys/create-srpm -upload-srpm = /usr/local/bin/mdv-youri-submit +upload-srpm = /usr/local/bin/mga-youri-submit # needed by mdvsys 2.0 install-buildrequires = sudo rurpmi --auto --no-suggests diff --git a/modules/buildsystem/templates/sudoers.youri b/modules/buildsystem/templates/sudoers.youri index 0ec7ae41..f3fa35b0 100644 --- a/modules/buildsystem/templates/sudoers.youri +++ b/modules/buildsystem/templates/sudoers.youri @@ -1,4 +1,4 @@ -Cmnd_Alias YOURI = /usr/local/bin/mdv-youri-submit.wrapper +Cmnd_Alias YOURI = /usr/local/bin/mga-youri-submit.wrapper Defaults!YOURI always_set_home Defaults!YOURI runas_default = <%= sched_login %> Defaults!YOURI !requiretty -- cgit v1.2.1