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

James Antill james at osuosl.org
Wed Oct 20 16:26:02 UTC 2010


 output.py      |   17 +++++++++++------
 yum/history.py |   19 ++++++++++++++++---
 2 files changed, 27 insertions(+), 9 deletions(-)

New commits:
commit c3d9f076387c7b277065d15f0531b32649baa2ed
Merge: d3977a5... 15dbcdd...
Author: James Antill <james at and.org>
Date:   Wed Oct 20 12:25:58 2010 -0400

    Merge branch 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum into yum-3_2_X
    
    * 'yum-3_2_X' of ssh://yum.baseurl.org/srv/projects/yum/git/yum:
      make sure we mark the other txmbr as obsoleting
      fix the unittests to remove the FIXMEs b/c now they are fixed.
      when depsolving - if we have a dep from an installed pkg. Check to see if the thing it requires is being updated or obsoleted. If it is being updated then try to update the requiring Pkg w/o obsoletes.
      make obsoletes a little more correct vis-a-vis rpm
      Avoid errors with empty completion words, BZ 644265.

commit d3977a53beb35719a2bc824ee806aaabae0a36bf
Author: James Antill <james at and.org>
Date:   Tue Oct 19 15:38:14 2010 -0400

    Allow packages-list to not take an arg. ... shows recent pkgs.

diff --git a/output.py b/output.py
index 5e2f073..a32a3a9 100755
--- a/output.py
+++ b/output.py
@@ -1900,9 +1900,9 @@ to exit.
         """ Shows the user a list of data about the history, from the point
             of a package(s) instead of via. transactions. """
         tids = self.history.search(extcmds)
+        limit = None
         if not tids:
-            self.logger.critical(_('Bad package(s), given (nothing found)'))
-            return 1, ['Failed history package-list']
+            limit = 20
 
         all_uistates = self._history_state2uistate
 
@@ -1913,7 +1913,10 @@ to exit.
                      utf8_width_fill(_("Package"), 53, 53))
         print "-" * 79
         fmt = "%6u | %s | %-50s"
-        for old in self.history.old(tids):
+        num = 0
+        for old in self.history.old(tids, limit=limit):
+            if limit is not None and num and (num +len(old.trans_data)) > limit:
+                break
             last = None
 
             # Copy and paste from list ... uh.
@@ -1935,9 +1938,10 @@ to exit.
                 lmark = '>'
 
             for hpkg in old.trans_data: # Find a pkg to go with each cmd...
-                x,m,u = yum.packages.parsePackages([hpkg], extcmds)
-                if not x and not m:
-                    continue
+                if limit is None:
+                    x,m,u = yum.packages.parsePackages([hpkg], extcmds)
+                    if not x and not m:
+                        continue
 
                 uistate = all_uistates.get(hpkg.state, hpkg.state)
                 uistate = utf8_width_fill(uistate, 14)
@@ -1963,6 +1967,7 @@ to exit.
                     if hpkg.state in ('Updated', 'Downgrade'):
                         last = hpkg
 
+                num += 1
                 print fmt % (old.tid, uistate, cn), "%s%s" % (lmark,rmark)
 
         # And, again, copy and paste...
commit af375859ba953aab504a65322b2eed2cf9448ecd
Author: James Antill <james at and.org>
Date:   Tue Oct 19 15:23:54 2010 -0400

    Split search patterns if we get too many, BZ 644432

diff --git a/yum/history.py b/yum/history.py
index a8004af..26d6ee2 100644
--- a/yum/history.py
+++ b/yum/history.py
@@ -1176,12 +1176,25 @@ class YumHistory:
             return set()
 
         data = _setupHistorySearchSQL(patterns, ignore_case)
-        (need_full, patterns, fields, names) = data
+        (need_full, npatterns, fields, names) = data
 
         ret = []
         pkgtupids = set()
-        for row in self._yieldSQLDataList(patterns, fields, ignore_case):
-            pkgtupids.add(row[0])
+
+        if npatterns:
+            for row in self._yieldSQLDataList(npatterns, fields, ignore_case):
+                pkgtupids.add(row[0])
+        else:
+            # Too many patterns, *sigh*
+            pat_max = PATTERNS_MAX
+            if not need_full:
+                pat_max = PATTERNS_INDEXED_MAX
+            for npatterns in yum.misc.seq_max_split(patterns, pat_max):
+                data = _setupHistorySearchSQL(npatterns, ignore_case)
+                (need_full, nps, fields, names) = data
+                assert nps
+                for row in self._yieldSQLDataList(nps, fields, ignore_case):
+                    pkgtupids.add(row[0])
 
         sql =  """SELECT tid FROM trans_data_pkgs WHERE pkgtupid IN """
         sql += "(%s)" % ",".join(['?'] * len(pkgtupids))


More information about the Yum-commits mailing list