[Yum-devel] [PATCH] Fix for InstallKernel operation test

James Bowes jbowes at redhat.com
Fri Jan 18 00:37:31 UTC 2008


Hey all:

Attached is a possible fix to our one failing unit test (where 'yum
install kernel' will bring in the oldest uninstalled kernel, and
installonlyn behaviour will set one of your installed but newer ones for
removal).

The patch is pretty dumb; it just gets rid of the special case for
allowedMultipleInstalls packages during install.

Can anyone see any valid use cases I might clobber if I apply?

Thanks,

-James
-------------- next part --------------
From 401d743d43038cf399cd0b81eef472ab93d39da0 Mon Sep 17 00:00:00 2001
From: James Bowes <jbowes at redhat.com>
Date: Thu, 17 Jan 2008 19:15:19 -0500
Subject: [PATCH] Fix for InstallKernel operation test.

'yum install' matches the arg against a package name, rather than a
full/partial nevra. The logic in the install command for the case where
to_install_po.EVR < installed_package_with_same_name.EVR assumed that
the 'exactmatch' list contained exact package matches, rather than
exact name matches. As a result, 'yum install kernel' would install the
EVR-greatest rpm of those available but not installed.
---
 cli.py |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/cli.py b/cli.py
index 78c0410..95a1db4 100644
--- a/cli.py
+++ b/cli.py
@@ -542,15 +542,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
                                 passToUpdate.append(pkg.pkgtup)
                         elif pkg.EVR == instpo.EVR: # same, ignore
                             continue
-                        elif pkg.EVR < instpo.EVR: # lesser, check if the pkgtup is an exactmatch
-                                           # if so then add it to be installed
-                                           # if it can be multiply installed
-                                           # this is where we could handle setting 
-                                           # it to be an 'oldpackage' revert.
-                                           
-                            if pkg in exactmatch and self.allowedMultipleInstalls(pkg):
-                                if not toBeInstalled.has_key(pkg.name): toBeInstalled[pkg.name] = []
-                                toBeInstalled[pkg.name].append(pkg)
+                        elif pkg.EVR < instpo.EVR:
+                            # lesser, ignore
+                            # XXX if 'install' understood versions, here is
+                            # where we'd have to worry about multiple install
+                            # packages, ie the kernel.
+                            continue
                 else: # we've not got any installed that match n or n+a
                     self.verbose_logger.log(yum.logginglevels.DEBUG_1, 'No other %s installed, adding to list for potential install', pkg.name)
                     if not toBeInstalled.has_key(pkg.name): toBeInstalled[pkg.name] = []
-- 
1.5.4.rc3.1118.gf6754c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20080117/5f3ebe63/attachment.pgp 


More information about the Yum-devel mailing list