diff options
author | Paul Nasrat <pnasrat@redhat.com> | 2005-08-30 15:42:51 +0000 |
---|---|---|
committer | Paul Nasrat <pnasrat@redhat.com> | 2005-08-30 15:42:51 +0000 |
commit | 8a4884aedd6fdb5c6444bd3841031d7862cd129b (patch) | |
tree | 09b70b3f7d6a513281bfd96e9dd26e342ec48956 /backend.py | |
parent | 29249ce1b83c9b5374d5de1829b75c43f4376c13 (diff) | |
download | anaconda-8a4884aedd6fdb5c6444bd3841031d7862cd129b.tar.gz anaconda-8a4884aedd6fdb5c6444bd3841031d7862cd129b.tar.xz anaconda-8a4884aedd6fdb5c6444bd3841031d7862cd129b.zip |
dispatch and yum backend integration
Diffstat (limited to 'backend.py')
-rw-r--r-- | backend.py | 69 |
1 files changed, 61 insertions, 8 deletions
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") + |