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 | |
| parent | b286f62221b6904405992502ad5f84846ba9f3ac (diff) | |
| download | python-apt-06b9dd32bed7a12dbdf92a61f81591ffff258a8b.tar.gz | |
* DistUpgrade/DistUpgradeCache.py:
- implement the suggestions from kiko (thanks!)
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 3 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog index 671f43c2..25d20acb 100644 --- a/DistUpgrade/Changelog +++ b/DistUpgrade/Changelog @@ -4,7 +4,8 @@ - updated translations - fix a missing bindtextdomain - fix a incorrect ngettext usage - - added quirks handler to fix nvidia-glx issue (#47433) + - added quirks handler to fix nvidia-glx issue (#47017) + Thanks to the amazing Kiko for helping improve this! 2006-05-24: - if the initial "update()" fails, just exit, don't try to restore the old sources.list (nothing was modified yet) 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: |
