diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-10-23 13:59:18 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-10-23 13:59:18 +0200 |
| commit | ae8796907bc0d690057bc661ca926dd6bc4554cc (patch) | |
| tree | 2ff85d91fa7a3b55a8f4ba455ff2ff229bbc2373 /DistUpgrade/DistUpgradeCache.py | |
| parent | 332b558cf5cf256712deaa7f827472683d763dbe (diff) | |
| download | python-apt-ae8796907bc0d690057bc661ca926dd6bc4554cc.tar.gz | |
* force downgrade of libgl1-mesa-dri package if unofficial compiz packages are installed (lp: #58424)
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 7df0b510..9c062c41 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -195,7 +195,23 @@ class MyCache(apt.Cache): self.markInstall(pkgname,"%s quirk upgrade rule" % pkgname) except SystemError, e: logging.debug("Failed to apply %s install (%s)" % (pkgname,e)) - + # libgl1-mesa-dri from xgl.compiz.info (and friends) breaks the + # upgrade, work around this here by downgrading the package + if self.has_key("libgl1-mesa-dri"): + pkg = self["libgl1-mesa-dri"] + # the version from the compiz repo has a "6.5.1+cvs20060824" ver + if (pkg.candidateVersion == pkg.installedVersion and + "+cvs2006" in pkg.candidateVersion): + for ver in pkg._pkg.VersionList: + # the "officual" edgy version has "6.5.1~20060817-0ubuntu3" + if "~2006" in ver.VerStr: + # ensure that it is from a trusted repo + for (VerFileIter, index) in ver.FileList: + indexfile = self._list.FindIndex(VerFileIter) + if indexfile and indexfile.IsTrusted: + logging.info("Forcing downgrade of libgl1-mesa-dri for xgl.compz.info installs") + self._depcache.SetCandidateVer(pkg._pkg, ver) + break def dapperQuirks(self): """ this function works around quirks in the breezy->dapper upgrade """ @@ -240,6 +256,15 @@ class MyCache(apt.Cache): for pkg in self.getChanges(): if pkg.markedDelete: continue + # special case because of a bug in pkg.candidateOrigin + if pkg.markedDowngrade: + for ver in pkg._pkg.VersionList: + # version is lower than installed one + if apt_pkg.VersionCompare(ver.VerStr, pkg.installedVersion) < 0: + for (verFileIter,index) in ver.FileList: + if not origin.trusted: + untrusted.append(pkg.name) + continue origins = pkg.candidateOrigin trusted = False for origin in origins: |
