[yum-commits] Branch 'yum-3_2_X' - 2 commits - etc/yum.bash rpmUtils/updates.py yum/__init__.py

Ville Skyttä scop at osuosl.org
Mon Apr 12 15:36:32 UTC 2010


 etc/yum.bash        |    9 ++++++++-
 rpmUtils/updates.py |   13 +++++--------
 yum/__init__.py     |   11 +----------
 3 files changed, 14 insertions(+), 19 deletions(-)

New commits:
commit c46e474d6db8f1e1d9aff21de44a3325535cb24f
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Apr 10 13:58:43 2010 +0300

    Clean up some unnecessary/redundant code.

diff --git a/rpmUtils/updates.py b/rpmUtils/updates.py
index 68dee45..935a4ac 100644
--- a/rpmUtils/updates.py
+++ b/rpmUtils/updates.py
@@ -75,14 +75,11 @@ class Updates:
 
     def _delFromNADict(self, dict_, pkgtup):
         (n, a, e, v, r) = pkgtup
-        if dict_.has_key((n, a)):
-            dict_[(n, a)] = filter((e,v,r).__ne__, dict_[(n, a)])
-            if not dict_[(n, a)]:
-                del dict_[(n, a)]
-        if dict_.has_key((n, None)):
-            dict_[(n, None)] = filter((e,v,r).__ne__, dict_[(n, None)])
-            if not dict_[(n, None)]:
-                del dict_[(n, None)]
+        for aa in (a, None):
+            if (n, aa) in dict_:
+                dict_[(n, aa)] = filter((e,v,r).__ne__, dict_[(n, aa)])
+                if not dict_[(n, aa)]:
+                    del dict_[(n, aa)]
 
     def delPackage(self, pkgtup):
         """remove available pkgtup that is no longer available"""
diff --git a/yum/__init__.py b/yum/__init__.py
index ed64441..e45d70a 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2022,7 +2022,6 @@ class YumBase(depsolve.Depsolve):
         elif pkgnarrow == 'recent':
             now = time.time()
             recentlimit = now-(self.conf.recent*86400)
-            ftimehash = {}
             if showdups:
                 avail = self.pkgSack.returnPackages(patterns=patterns,
                                                     ignore_case=ic)
@@ -2034,15 +2033,7 @@ class YumBase(depsolve.Depsolve):
                     avail = []
             
             for po in avail:
-                ftime = int(po.filetime)
-                if ftime > recentlimit:
-                    if not ftimehash.has_key(ftime):
-                        ftimehash[ftime] = [po]
-                    else:
-                        ftimehash[ftime].append(po)
-
-            for sometime in ftimehash:
-                for po in ftimehash[sometime]:
+                if int(po.filetime) > recentlimit:
                     recent.append(po)
         
         
commit 7fc1a9491a0fc74ec9cf4e95f3c28a0e86c408cd
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Apr 10 13:47:48 2010 +0300

    Add basic version completion.

diff --git a/etc/yum.bash b/etc/yum.bash
index 966e33a..0fcba24 100644
--- a/etc/yum.bash
+++ b/etc/yum.bash
@@ -102,7 +102,7 @@ _yum()
             ;;
 
         check-update|grouplist|makecache|provides|whatprovides|resolvedep|\
-        search|version)
+        search)
             return 0
             ;;
 
@@ -214,6 +214,13 @@ _yum()
             fi
             return 0
             ;;
+        version)
+            if [ "$prev" = version ] ; then
+                COMPREPLY=( $( compgen -W 'all installed available nogroups
+                    grouplist groupinfo' -- "$cur" ) )
+            fi
+            return 0
+            ;;
     esac
 
     local split=false


More information about the Yum-commits mailing list