diff options
author | Nicolas Vigier <boklm@mageia.org> | 2012-12-11 11:33:39 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2012-12-11 11:33:39 +0000 |
commit | 517adb146cd95239aa09dd8979ab6da02e41bbea (patch) | |
tree | 19353fd698b716a2ab75ebeb952c3a5d8fd59691 /modules/buildsystem/files/signbot/mga-signpackage | |
parent | 5d0f5ae981faf258f11fdbcd24bc50e1de05889a (diff) | |
download | puppet-517adb146cd95239aa09dd8979ab6da02e41bbea.tar puppet-517adb146cd95239aa09dd8979ab6da02e41bbea.tar.gz puppet-517adb146cd95239aa09dd8979ab6da02e41bbea.tar.bz2 puppet-517adb146cd95239aa09dd8979ab6da02e41bbea.tar.xz puppet-517adb146cd95239aa09dd8979ab6da02e41bbea.zip |
buildsystem::signbot: move files from templates to files directory
The following files have been moved from templates to files directory
because they don't use any templating :
- mga-signpackage
- signbot-rpmmacros
- sign-check-package
Diffstat (limited to 'modules/buildsystem/files/signbot/mga-signpackage')
-rwxr-xr-x | modules/buildsystem/files/signbot/mga-signpackage | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/buildsystem/files/signbot/mga-signpackage b/modules/buildsystem/files/signbot/mga-signpackage new file mode 100755 index 00000000..bd88efeb --- /dev/null +++ b/modules/buildsystem/files/signbot/mga-signpackage @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use RPM4::Sign; +use File::Spec; + +sub signpackage { + my ($file, $name, $path) = @_; + + # check if parent directory is writable + my $parent = (File::Spec->splitpath($file))[1]; + die "Unsignable package, parent directory is read-only" + unless -w $parent; + + my $sign = RPM4::Sign->new( + name => $name, + path => $path, + passphrase => '', + ); + + $sign->rpmssign($file) +} + +if (@ARGV != 3) { + exit 1; +} + +signpackage(@ARGV); +exit 0 + |