[kernel] r11169 - people/waldi/dkt/bin

Bastian Blank waldi at alioth.debian.org
Fri Apr 25 13:22:33 UTC 2008


Author: waldi
Date: Fri Apr 25 13:22:32 2008
New Revision: 11169

Log:
bin/dkt-maintainer: Move common implementation.


Modified:
   people/waldi/dkt/bin/dkt-maintainer

Modified: people/waldi/dkt/bin/dkt-maintainer
==============================================================================
--- people/waldi/dkt/bin/dkt-maintainer	(original)
+++ people/waldi/dkt/bin/dkt-maintainer	Fri Apr 25 13:22:32 2008
@@ -12,9 +12,13 @@
 from dkt.config.base import Config
 
 class MainAll(MainBase, MainBackwardKpkg):
-    def __init__(self, package, version):
+    def __init__(self, package, version, command, *args):
         super(MainAll, self).__init__()
-        self.package, self.version = package, version
+        self.package, self.version, self.command, self.args = package, version, command, args
+
+        if self.command not in self.commands:
+            sys.stderr.write("%s called with unknown argument '%s'\n" % (self.type, self.command))
+            sys.exit(1)
 
         if self.config.get('backward-compatibility', 'use-kpkg-config', False) and os.path.exists("/etc/kernel-img.conf"):
             self.systemconfig_read_kpkg(file("/etc/kernel-img.conf"))
@@ -32,13 +36,8 @@
     commands_systemtask = ('install', 'upgrade')
     type = 'preinst'
 
-    def __init__(self, package, version, command, *args):
-        super(MainAllPreInst, self).__init__(package, version)
-        self.command, self.args = command, args
-
-        if self.command not in self.commands:
-            sys.stderr.write("%s called with unknown argument '%s'\n" % (self.type, self.command))
-            sys.exit(1)
+    def __init__(self, *args):
+        super(MainAllPreInst, self).__init__(*args)
 
         self.itemconfig = self.itemconfig_create()
 
@@ -51,13 +50,8 @@
     commands_systemtask = ('configure',)
     type = 'postinst'
 
-    def __init__(self, package, version, command, *args):
-        super(MainAllPostInst, self).__init__(package, version)
-        self.command, self.args = command, args
-
-        if self.command not in self.commands:
-            sys.stderr.write("%s called with unknown argument '%s'\n" % (self.type, self.command))
-            sys.exit(1)
+    def __init__(self, *args):
+        super(MainAllPostInst, self).__init__(*args)
 
         try:
             self.itemconfig = self.itemconfig_get(self.package)
@@ -74,13 +68,8 @@
     commands_systemtask = ('remove', 'upgrade')
     type = 'prerm'
 
-    def __init__(self, package, version, command, *args):
-        super(MainAllPreRm, self).__init__(package, version)
-        self.command, self.args = command, args
-
-        if self.command not in self.commands:
-            sys.stderr.write("%s called with unknown argument '%s'\n" % (self.type, self.command))
-            sys.exit(1)
+    def __init__(self, *args):
+        super(MainAllPreRm, self).__init__(*args)
 
         try:
             self.itemconfig = self.itemconfig_get(self.package)
@@ -97,13 +86,8 @@
     commands_systemtask = ('purge', 'remove')
     type = 'postrm'
 
-    def __init__(self, package, version, command, *args):
-        super(MainAllPostRm, self).__init__(package, version)
-        self.command, self.args = command, args
-
-        if self.command not in self.commands:
-            sys.stderr.write("%s called with unknown argument '%s'\n" % (self.type, self.command))
-            sys.exit(1)
+    def __init__(self, *args):
+        super(MainAllPostRm, self).__init__(*args)
 
         self.itemconfig = self.itemconfig_create()
 



More information about the Kernel-svn-changes mailing list