summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeControler.py
diff options
context:
space:
mode:
Diffstat (limited to 'DistUpgrade/DistUpgradeControler.py')
-rw-r--r--DistUpgrade/DistUpgradeControler.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 13050f49..a51fa485 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -86,10 +86,20 @@ class AptCdrom(object):
class DistUpgradeControler(object):
""" this is the controler that does most of the work """
- def __init__(self, distUpgradeView, cdromPath=None):
- gettext.bindtextdomain("update-manager",os.path.join(os.getcwd(),"mo"))
+ def __init__(self, distUpgradeView, cdromPath=None, datadir=None):
+ # setup the pathes
+ localedir = "/usr/share/locale/update-manager/"
+ if datadir == None:
+ datadir = os.getcwd()
+ localedir = os.path.join(datadir,"mo")
+ gladedir = datadir
+ self.datadir = datadir
+
+ # init gettext
+ gettext.bindtextdomain("update-manager",localedir)
gettext.textdomain("update-manager")
+ # setup the view
self._view = distUpgradeView
self._view.updateStatus(_("Reading cache"))
self.cache = None
@@ -98,8 +108,8 @@ class DistUpgradeControler(object):
self.aptcdrom = AptCdrom(distUpgradeView, cdromPath)
self.useNetwork = True
- # the configuration
- self.config = DistUpgradeConfig()
+ # the configuration
+ self.config = DistUpgradeConfig(datadir)
self.sources_backup_ext = "."+self.config.get("Files","BackupExt")
# some constants here
@@ -113,13 +123,14 @@ class DistUpgradeControler(object):
# turn on debuging in the cache
apt_pkg.Config.Set("Debug::pkgProblemResolver","true")
apt_pkg.Config.Set("Debug::pkgDepCache::AutoInstall","true")
+ # FIXME: make this "append"?
fd = os.open("/var/log/dist-upgrade/apt.log",
os.O_RDWR|os.O_CREAT|os.O_TRUNC, 0644)
os.dup2(fd,1)
os.dup2(fd,2)
def openCache(self):
- self.cache = MyCache(self._view.getOpCacheProgress())
+ self.cache = MyCache(self.config, self._view.getOpCacheProgress())
def prepare(self):
""" initial cache opening, sanity checking, network checking """