[yum-commits] plugins/rpm-warm-cache

James Antill james at osuosl.org
Fri Nov 21 16:45:19 UTC 2008


 plugins/rpm-warm-cache/rpm-warm-cache.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit fae5b429d0e491e17397921769cb0df4a4b5e33c
Author: James Antill <james at and.org>
Date:   Fri Nov 21 11:45:14 2008 -0500

    If we don't have a command, or it's search/list/info, warm the rpm DB cache

diff --git a/plugins/rpm-warm-cache/rpm-warm-cache.py b/plugins/rpm-warm-cache/rpm-warm-cache.py
index 3f5ba4f..93e7243 100644
--- a/plugins/rpm-warm-cache/rpm-warm-cache.py
+++ b/plugins/rpm-warm-cache/rpm-warm-cache.py
@@ -31,9 +31,10 @@ def postreposetup_hook(conduit):
     try:
         cmd = commands[0]
     except IndexError:
-        # No command given, don't do anything
-        return
-    if cmd in ('upgrade', 'install', 'remove'):
+        # No command given, do it as it's cheap enough
+        cmd = 'install'
+    if (cmd in ('upgrade', 'install', 'remove', 'search') or
+        cmd.startswith('list') or cmd.startswith('info')):
         try:
             for root, dirs, files in walk('/var/lib/rpm'):
                 for file in files:


More information about the Yum-commits mailing list