From 8a4884aedd6fdb5c6444bd3841031d7862cd129b Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Tue, 30 Aug 2005 15:42:51 +0000 Subject: dispatch and yum backend integration --- backend.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 8 deletions(-) (limited to 'backend.py') diff --git a/backend.py b/backend.py index 49bbf6690..7339e264e 100644 --- a/backend.py +++ b/backend.py @@ -15,23 +15,76 @@ import logging log = logging.getLogger("anaconda") +class ProxyBackend: + def __init__(self, object=None): + self.object = object + + def __getattr__(self, attr): + if self.object: + return getattr(self.object, attr) + class AnacondaBackend: def __init__(self, method): self.method = method + self.instLog = None + self.modeText = "" - def readPackages(self, intf, id): - """Set id.grpset and id.pkglist""" - id.grpset = [] - id.pkglist = [] + def doPreSelection(self, intf, id, instPath): + pass - def doPreSelection(self): + def doPostSelection(self, intf, id, instPath): pass - def doPostSelection(self): + def doPreInstall(self, intf, id, instPath, dir): pass - def doPreInstall(self): + def doPostInstall(self, intf, id, instPath): pass - def doPostInstall(self): + def doInstall(self, intf, id, instPath): pass + + def initLog(self, id, instPath): + upgrade = id.getUpgrade() + + if upgrade: + logname = '/root/upgrade.log' + else: + logname = '/root/install.log' + + instLogName = instPath + logname + try: + iutil.rmrf (instLogName) + except OSError: + pass + + instLog = open(instLogName, "w+") + if upgrade: + logname = '/root/upgrade.log' + else: + logname = '/root/install.log' + + instLogName = instPath + logname + try: + iutil.rmrf (instLogName) + except OSError: + pass + + self.instLog = open(instLogName, "w+") + + # dont start syslogd if we arent creating filesystems + if flags.setupFilesystems: + syslogname = "%s%s.syslog" % (instPath, logname) + try: + iutil.rmrf (syslogname) + except OSError: + pass + syslog.start (instPath, syslogname) + else: + syslogname = None + + if upgrade: + self.modeText = _("Upgrading %s-%s-%s.%s.\n") + else: + self.modeText = _("Installing %s-%s-%s.%s.\n") + -- cgit