summaryrefslogtreecommitdiffstats
path: root/backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend.py')
-rw-r--r--backend.py69
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")
+