[yum-git] yumcommands.py yum/__init__.py

Seth Vidal skvidal at linux.duke.edu
Tue Feb 5 06:17:37 UTC 2008


 yum/__init__.py |   15 +++++++++++----
 yumcommands.py  |    1 -
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit f2df1d6735ea11dabb379a270310a7e3db838892
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Feb 5 01:16:13 2008 -0500

    make sure we're installing exactly what we're removing on a reinstall
    if we can't then bail.
    
    remove unneeded rpm import

diff --git a/yum/__init__.py b/yum/__init__.py
index b63d088..f55aaed 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2446,10 +2446,17 @@ class YumBase(depsolve.Depsolve):
         if not tx_mbrs:
             raise Errors.RemoveError, _("Problem in reinstall: no package matched to remove")
         templen = len(tx_mbrs)
-        tx_mbrs.extend(self.install(po, **kwargs))
-        if len(tx_mbrs) == templen:
-            raise Errors.RemoveError, _("Problem in reinstall: no package matched to install")
-
+        # this is a reinstall, so if we can't reinstall exactly what we uninstalled
+        # then we really shouldn't go on
+        new_members = []
+        for item in tx_mbrs:
+            members = self.install(name=item.name, arch=item.arch,
+                           ver=item.version, release=item.release, epoch=item.epoch)
+            if len(members) == 0:
+                raise Errors.RemoveError, _("Problem in reinstall: no package matched to install")
+            new_members.extend(members)
+
+        tx_mbrs.extend(new_members)            
         return tx_mbrs
         
 
diff --git a/yumcommands.py b/yumcommands.py
index 2a1247a..a9f69e2 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -24,7 +24,6 @@ import cli
 from yum import logginglevels
 import yum.Errors
 from yum.i18n import _
-import rpm
 
 
 def checkRootUID(base):



More information about the Yum-cvs-commits mailing list