From a2fdb1aa3e9fbc31f92a2292862a40b42a0c2534 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Aug 28 2007 13:45:32 +0000 Subject: - fix some depsolving cases --- diff --git a/depsolve-fixes.patch b/depsolve-fixes.patch new file mode 100644 index 0000000..35022ee --- /dev/null +++ b/depsolve-fixes.patch @@ -0,0 +1,69 @@ +diff --git a/yum/depsolve.py b/yum/depsolve.py +index e5d55b7..57933cb 100644 +--- a/yum/depsolve.py ++++ b/yum/depsolve.py +@@ -407,7 +407,8 @@ class Depsolve(object): + (needname, needflags, needversion) = requirement + checkdeps = 0 + missingdep = 0 +- ++ upgraded = {} ++ + #~ - if it's not available from some repository: + #~ - mark as unresolveable. + # +@@ -442,7 +443,7 @@ class Depsolve(object): + # installed or in the ts, and this isn't a package that allows multiple installs + # then if it's newer, fine - continue on, if not, then we're unresolveable + # cite it and exit +- ++ + tspkgs = [] + if not self.allowedMultipleInstalls(pkg): + # from ts +@@ -453,6 +454,8 @@ class Depsolve(object): + self.verbose_logger.log(logginglevels.DEBUG_2, msg) + provSack.delPackage(pkg) + continue ++ elif tspkg.po.EVR < pkg.EVR: ++ upgraded.setdefault(pkg.pkgtup, []).append(tspkg.pkgtup) + + # from rpmdb + dbpkgs = self.rpmdb.searchNevra(name=pkg.name, arch=pkg.arch) +@@ -552,6 +555,12 @@ class Depsolve(object): + txmbr = self.tsInfo.addInstall(best) + txmbr.setAsDep() + ++ # if we had other packages with this name.arch that we found ++ # before, they're not going to be installed anymore, so we ++ # should mark them to be re-checked ++ if upgraded.has_key(best.pkgtup): ++ map(lambda x: self.tsInfo.remove(x), upgraded[best.pkgtup]) ++ + checkdeps = 1 + + return checkdeps, missingdep +@@ -759,7 +768,9 @@ class Depsolve(object): + CheckDeps = False + CheckInstalls = False + CheckRemoves = False +- for txmbr in self.tsInfo.getMembers() + self.tsInfo.getRemovedMembers(): ++ # we need to check the opposite of install and remove for regular ++ # tsInfo members vs removed members ++ for (txmbr, inst, rem) in map(lambda x: (x, TS_INSTALL_STATES, TS_REMOVE_STATES), self.tsInfo.getMembers()) + map(lambda x: (x, TS_REMOVE_STATES, TS_INSTALL_STATES), self.tsInfo.getRemovedMembers()): + if (self._dcobj.already_seen_removed.has_key(txmbr) or + (txmbr.ts_state is not None and self._dcobj.already_seen.has_key(txmbr))): + continue +@@ -769,10 +780,10 @@ class Depsolve(object): + self.verbose_logger.log(logginglevels.DEBUG_2, + "Checking deps for %s" %(txmbr,)) + +- if txmbr.output_state in TS_INSTALL_STATES: ++ if txmbr.output_state in inst: + thisneeds = self._checkInstall(txmbr) + CheckInstalls = True +- elif txmbr.output_state in TS_REMOVE_STATES: ++ elif txmbr.output_state in rem: + thisneeds = self._checkRemove(txmbr) + CheckRemoves = True + diff --git a/yum.spec b/yum.spec index 80b12fe..3d0923d 100644 --- a/yum.spec +++ b/yum.spec @@ -3,7 +3,7 @@ Summary: RPM installer/updater Name: yum Version: 3.2.3 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://linux.duke.edu/projects/yum/download/3.2/%{name}-%{version}.tar.gz @@ -11,6 +11,7 @@ Source1: yum.conf.fedora Source2: yum-updatesd.conf.fedora Patch0: installonlyn-enable.patch Patch1: cli-ouput-fix.patch +Patch2: depsolve-fixes.patch URL: http://linux.duke.edu/yum/ BuildArch: noarch @@ -47,6 +48,7 @@ can notify you when they are available via email, syslog or dbus. %setup -q %patch0 -p0 -b .installonly %patch1 -p1 -b .cli-output +%patch2 -p1 -b .deps %build make @@ -92,6 +94,9 @@ rm -rf $RPM_BUILD_ROOT %dir /usr/lib/yum-plugins %changelog +* Tue Aug 28 2007 Jeremy Katz - 3.2.3-3 +- fix some depsolving cases + * Thu Aug 23 2007 Seth Vidal 3.2.3-2 - add patch to fix bug when yum is redirected to a pipe/file