aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-01-20 17:35:27 +0000
committerNicolas Vigier <boklm@mageia.org>2011-01-20 17:35:27 +0000
commit7654a1f262d0da0cb3ddea8c92baf07cfab3b1be (patch)
treeaf04e15484a310e75a3965a9d3709d7d8f444f6b /bin
parent070375858115c58bacd63ec880236f1ddac33612 (diff)
downloadmga-youri-submit-7654a1f262d0da0cb3ddea8c92baf07cfab3b1be.tar
mga-youri-submit-7654a1f262d0da0cb3ddea8c92baf07cfab3b1be.tar.gz
mga-youri-submit-7654a1f262d0da0cb3ddea8c92baf07cfab3b1be.tar.bz2
mga-youri-submit-7654a1f262d0da0cb3ddea8c92baf07cfab3b1be.tar.xz
mga-youri-submit-7654a1f262d0da0cb3ddea8c92baf07cfab3b1be.zip
move mga-signpackage to bin directory and add it in Makefile.PL
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mga-signpackage29
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);
+