diff options
author | Olivier Blin <blino@mageia.org> | 2011-04-04 22:59:01 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2011-04-04 22:59:01 +0000 |
commit | 699c5e78d5512a2779ce834882cfdda895db32b1 (patch) | |
tree | 0e1d060beb87008d7e266d6fbafb071c8bce10e9 /bin/mga-signpackage | |
parent | b06110139b89597dbe34d33b907538c93991bfe4 (diff) | |
parent | 51d5d4e7a0d1d1cca9a5214782575b5f8aa7aa8b (diff) | |
download | mga-youri-submit-699c5e78d5512a2779ce834882cfdda895db32b1.tar mga-youri-submit-699c5e78d5512a2779ce834882cfdda895db32b1.tar.gz mga-youri-submit-699c5e78d5512a2779ce834882cfdda895db32b1.tar.bz2 mga-youri-submit-699c5e78d5512a2779ce834882cfdda895db32b1.tar.xz mga-youri-submit-699c5e78d5512a2779ce834882cfdda895db32b1.zip |
rename mdv-youri-submit as mga-youri-submit
Diffstat (limited to 'bin/mga-signpackage')
-rwxr-xr-x | bin/mga-signpackage | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/mga-signpackage b/bin/mga-signpackage new file mode 100755 index 0000000..435e92e --- /dev/null +++ b/bin/mga-signpackage @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w + +use strict; +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); + |