aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-01-20 17:10:16 +0000
committerNicolas Vigier <boklm@mageia.org>2011-01-20 17:10:16 +0000
commit070375858115c58bacd63ec880236f1ddac33612 (patch)
tree841eadfa10cea5b35ec8c977e45c2dd284f95a44 /lib
parent5c6ecec2883da9738911338811b275704f256b1b (diff)
downloadmga-youri-submit-070375858115c58bacd63ec880236f1ddac33612.tar
mga-youri-submit-070375858115c58bacd63ec880236f1ddac33612.tar.gz
mga-youri-submit-070375858115c58bacd63ec880236f1ddac33612.tar.bz2
mga-youri-submit-070375858115c58bacd63ec880236f1ddac33612.tar.xz
mga-youri-submit-070375858115c58bacd63ec880236f1ddac33612.zip
use mga-signpackage script with sudo to sign packages
Diffstat (limited to 'lib')
-rw-r--r--lib/Youri/Submit/Action/Sign.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Youri/Submit/Action/Sign.pm b/lib/Youri/Submit/Action/Sign.pm
index f016351..d9580b8 100644
--- a/lib/Youri/Submit/Action/Sign.pm
+++ b/lib/Youri/Submit/Action/Sign.pm
@@ -19,6 +19,8 @@ use base qw/Youri::Submit::Action/;
sub _init {
my $self = shift;
my %options = (
+ signuser => 'signbot',
+ signscript => '/usr/bin/mga-signpackage',
name => '',
path => $ENV{HOME} . '/.gnupg',
passphrase => '',
@@ -32,17 +34,17 @@ sub _init {
$self->{_name} = $options{name};
$self->{_path} = $options{path};
$self->{_passphrase} = $options{passphrase};
+ $self->{_signuser} = $options{signuser};
+ $self->{_signscript} = $options{signscript};
}
sub run {
my ($self, $package, $repository, $target, $define) = @_;
croak "Not a class method" unless ref $self;
- $package->sign(
- $self->{_name},
- $self->{_path},
- $self->{_passphrase}
- ) unless $self->{_test};
+ if (! $self->{_test}) {
+ system('/usr/bin/sudo', '-u', $self->{_signuser}, $self->{_signscript}, $package->{_file}, $self->{_name}, $self->{_path}) == 0;
+ }
}
=head1 COPYRIGHT AND LICENSE