[Mageia-sysadm] [330] add script to sign package

root at mageia.org root at mageia.org
Thu Jan 20 17:38:50 CET 2011


Revision: 330
Author:   boklm
Date:     2011-01-20 17:38:50 +0100 (Thu, 20 Jan 2011)
Log Message:
-----------
add script to sign package

Added Paths:
-----------
    build_system/mdv-youri-submit/trunk/mga-signpackage

Added: build_system/mdv-youri-submit/trunk/mga-signpackage
===================================================================
--- build_system/mdv-youri-submit/trunk/mga-signpackage	                        (rev 0)
+++ build_system/mdv-youri-submit/trunk/mga-signpackage	2011-01-20 16:38:50 UTC (rev 330)
@@ -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);
+


Property changes on: build_system/mdv-youri-submit/trunk/mga-signpackage
___________________________________________________________________
Added: svn:executable
   + *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110120/49ef163e/attachment.html>


More information about the Mageia-sysadm mailing list