diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-06-01 14:34:30 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-06-01 14:34:30 +0200 |
| commit | 06b9dd32bed7a12dbdf92a61f81591ffff258a8b (patch) | |
| tree | b091813140b6093626110b2a795bd52feca94dc9 /DistUpgrade/DistUpgradeCache.py | |
| parent | b286f62221b6904405992502ad5f84846ba9f3ac (diff) | |
| download | python-apt-06b9dd32bed7a12dbdf92a61f81591ffff258a8b.tar.gz | |
* DistUpgrade/DistUpgradeCache.py:
- implement the suggestions from kiko (thanks!)
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 55dc5839..bd9b00df 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -126,19 +126,19 @@ class MyCache(apt.Cache): action(pkg, "%s PostUpgrade%s rule" % (key, rule)) # get the distro-specific quirks handler and run it - quirksFunc = "%sQuirks" % self.config.get("Sources","To") - if quirksFunc in dir(self): - eval("self.%s()"%quirksFunc) - + quirksFuncName = "%sQuirks" % self.config.get("Sources","To") + func = getattr(self, quirksFuncName, None) + if func is not None: + func() def dapperQuirks(self): """ this function works around quirks in the breezy->dapper upgrade """ logging.debug("running dapperQuirks handler") - if self.has_key("nvidia-glx") and self["nvidia-glx"].isInstalled: - if self.has_key("nvidia-settings") and self["nvidia-settings"].isInstalled: - logging.debug("nvidia-settings and nvidia-glx is installed") - self.markRemove("nvidia-settings") - self.markInstall("nvidia-glx") + if (self.has_key("nvidia-glx") and self["nvidia-glx"].isInstalled and + self.has_key("nvidia-settings") and self["nvidia-settings"].isInstalled): + logging.debug("nvidia-settings and nvidia-glx is installed") + self.markRemove("nvidia-settings") + self.markInstall("nvidia-glx") def distUpgrade(self, view): try: |
