diff bin/treepkgbuilder.py @ 184:83c77307ffb1

Add the addkey command to bin/treepkgbuilder.py and a corresponding method to the PBuilder class.
author Bernhard Herzog <bh@intevation.de>
date Wed, 25 Jun 2008 15:15:30 +0000
parents df7498d0bd9d
children eaadf5350a1a
line wrap: on
line diff
--- a/bin/treepkgbuilder.py	Wed Jun 25 15:14:27 2008 +0000
+++ b/bin/treepkgbuilder.py	Wed Jun 25 15:15:30 2008 +0000
@@ -90,6 +90,27 @@
         builder.update(suppress_output=False, log_info=False)
 
 
+class AddKeyCommand(Command):
+
+    names = ("addkey", "add-key")
+
+    def __init__(self, arguments):
+        super(AddKeyCommand, self).__init__(arguments)
+        if not self.opts.key_id:
+            print >>sys.stderr, "No key id given"
+            sys.exit(1)
+
+    def create_parser(self):
+        parser = super(AddKeyCommand, self).create_parser()
+        parser.add_option("--key-id",
+                          help=("The id of the key to add.  Required."))
+        return parser
+
+    def run(self):
+        builder = self.get_builder()
+        builder.add_apt_key(self.opts.key_id)
+
+
 class HelpCommand(Command):
 
     names = ("help", "--help", "-h")
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)