Author: waldi Date: Tue Feb 19 18:12:20 2008 New Revision: 10613 Log: bin/dkt-maintainer: Only check image config for images.
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 Tue Feb 19 18:12:20 2008 @@ -31,12 +31,6 @@ sys.stderr.write("postinst called with unknown argument '%s'\n" % self.command) sys.exit(1) - try: - self.imageconfig = self.imageconfig_get(package) - except KeyError: - sys.stderr.write("Can't find image config for package %s\n" % self.package) - sys.exit(1) - def run_systemtask(self): if self.command in ('configure',): super(MainAllPostInst, self).run_systemtask('postinst') @@ -50,12 +44,6 @@ sys.stderr.write("prerm called with unknown argument '%s'\n" % self.command) sys.exit(1) - try: - self.imageconfig = self.imageconfig_get(package) - except KeyError: - sys.stderr.write("Can't find image config for package %s\n" % self.package) - sys.exit(1) - def run_systemtask(self): if self.command in ('remove', 'upgrade'): super(MainAllPreRm, self).run_systemtask('prerm') @@ -80,12 +68,30 @@ raise NotImplementedError class MainImagePostInst(MainAllPostInst): + def __init__(self, *args): + super(MainImagePostInst, self).__init__(*args) + + try: + self.imageconfig = self.imageconfig_get(self.package) + except KeyError: + sys.stderr.write("Can't find image config for package %s\n" % self.package) + sys.exit(1) + def __call__(self): self.run_systemtask() self.run_imagetask('postinst', self.imageconfig, (self.command,) + self.args) raise NotImplementedError class MainImagePreRm(MainAllPreRm): + def __init__(self, *args): + super(MainImagePreRm, self).__init__(*args) + + try: + self.imageconfig = self.imageconfig_get(self.package) + except KeyError: + sys.stderr.write("Can't find image config for package %s\n" % self.package) + sys.exit(1) + def __call__(self): self.run_systemtask() self.run_imagetask('prerm', self.imageconfig, (self.command,) + self.args) _______________________________________________ Kernel-svn-changes mailing list Kernel-svn-changes@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/kernel-svn-changes