[yum-commits] Branch 'yum-3_2_X' - 2 commits - output.py yum/history.py yum/__init__.py yum/packageSack.py

James Antill james at osuosl.org
Mon Oct 12 14:03:03 UTC 2009


 output.py          |    2 ++
 yum/__init__.py    |    4 +++-
 yum/history.py     |    3 +++
 yum/packageSack.py |   11 +++++++----
 4 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit c99cbd6d21a49a217e160de94770c22e84c3c89b
Author: James Antill <james at and.org>
Date:   Mon Oct 12 02:38:53 2009 -0400

     Add "Dep-Install" as a state to history.
    
     This is mostly an output tweak for "yum history info", however we now
    don't manually install a Dep-Install on redo.
       This means yumdb.reason is correct, and is probably what the user
      wants the majority of the time.

diff --git a/output.py b/output.py
index d0b9f7f..da84221 100755
--- a/output.py
+++ b/output.py
@@ -1181,6 +1181,8 @@ to exit.
             st = hpkg.state
             if st == 'True-Install':
                 st = 'Install'
+            if st == 'Dep-Install': # Mask these at the higher levels
+                st = 'Install'
             if st == 'Obsoleted': #  This is just a UI tweak, as we can't have
                                   # just one but we need to count them all.
                 st = 'Obsoleting'
diff --git a/yum/__init__.py b/yum/__init__.py
index 8d093db..6af81b8 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3610,6 +3610,8 @@ class YumBase(depsolve.Depsolve):
         """ Given a valid historical transaction object, try and repeat
             that transaction. """
         # NOTE: This is somewhat basic atm. ... see comment in undo.
+        #  Also note that redo doesn't force install Dep-Install packages,
+        # which is probably what is wanted the majority of the time.
         old_conf_obs = self.conf.obsoletes
         self.conf.obsoletes = False
         done = False
@@ -3670,7 +3672,7 @@ class YumBase(depsolve.Depsolve):
                 if self.remove(pkgtup=pkg.pkgtup):
                     done = True
         for pkg in transaction.trans_data:
-            if pkg.state in ('Install', 'True-Install'):
+            if pkg.state in ('Dep-Install', 'Install', 'True-Install'):
                 if self.remove(pkgtup=pkg.pkgtup):
                     done = True
         for pkg in transaction.trans_data:
diff --git a/yum/history.py b/yum/history.py
index 644c2fc..97571c5 100644
--- a/yum/history.py
+++ b/yum/history.py
@@ -47,6 +47,7 @@ _sttxt2stcode = {'Update' : TS_UPDATE,
                  'Erase' : TS_ERASE,
                  'Install' : TS_INSTALL, 
                  'True-Install' : TS_TRUEINSTALL,
+                 'Dep-Install' : TS_INSTALL,
                  'Reinstall' : TS_INSTALL, # Broken
                  'Downgrade' : TS_INSTALL, # Broken
                  'Downgraded' : TS_INSTALL, # Broken
@@ -292,6 +293,8 @@ class YumHistory:
                 state = 'Downgraded'
         if state is None:
             state = _stcode2sttxt.get(txmbr.output_state)
+            if state == 'Install' and txmbr.isDep:
+                state = 'Dep-Install'
         return state
 
     def trans_with_pid(self, pid):
commit 287e5ee6125c9f2d7fb9e4cbf0f478ce07a5704a
Author: James Antill <james at and.org>
Date:   Mon Oct 12 02:09:49 2009 -0400

     If X-1 and X-2 both provide/require FOO then X is a leaf node:
    
     Given nothing else requires what they provide.
    
     This fixes real false negatives in pkgSack, however this is unlikely to
    affect rpmdb as there is always just one version installed when we care.
    
     Also, a minor memory resource improvement.

diff --git a/yum/packageSack.py b/yum/packageSack.py
index 45e4e2d..33fdbfe 100644
--- a/yum/packageSack.py
+++ b/yum/packageSack.py
@@ -332,15 +332,18 @@ class PackageSackBase(object):
             for r in po.requires_names:
                 if not req.has_key(r):
                     req[r] = set()
-                req[r].add(po)
+                if len(req[r]) > 1: #  We only need to know if another pkg.
+                    continue        # reqs. the provide. So 2 pkgs. is enough.
+                req[r].add(po.name)
      
         for po in self.returnPackages(repoid=repoid):
             preq = 0
             for p in _return_all_provides(po):
                 if req.has_key(p):
-                    # Don't count a package that provides its require
-                    s = req[p]
-                    if len(s) > 1 or po not in s:
+                    #  If this pkg provides something that is required by
+                    # anything but itself (or another version of itself) it
+                    # isn't an orphan.
+                    if len(req[p]) > 1 or po.name not in req[p]:
                         preq += 1
                         break
         


More information about the Yum-commits mailing list