From ae8796907bc0d690057bc661ca926dd6bc4554cc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 23 Oct 2006 13:59:18 +0200 Subject: * force downgrade of libgl1-mesa-dri package if unofficial compiz packages are installed (lp: #58424) --- DistUpgrade/DistUpgradeCache.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'DistUpgrade/DistUpgradeCache.py') 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: -- cgit v1.2.3