[yum-commits] Branch 'yum-3_2_X' - yum/__init__.py yum/misc.py yum/plugins.py

James Antill james at osuosl.org
Fri Jan 23 18:14:59 UTC 2009


 yum/__init__.py |    2 +-
 yum/misc.py     |    4 ++--
 yum/plugins.py  |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 62885a99a41d7877bb204b6f157e6f6b4db264f3
Author: James Antill <james at and.org>
Date:   Fri Jan 23 13:14:50 2009 -0500

    Sort glob data where it can affect what happens

diff --git a/yum/__init__.py b/yum/__init__.py
index 06f0b19..d2ea312 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -318,7 +318,7 @@ class YumBase(depsolve.Depsolve):
                 reposdir = self.conf.installroot + '/' + reposdir
 
             if os.path.isdir(reposdir):
-                for repofn in glob.glob('%s/*.repo' % reposdir):
+                for repofn in sorted(glob.glob('%s/*.repo' % reposdir)):
                     thisrepo_age = os.stat(repofn)[8]
                     if thisrepo_age < repo_config_age:
                         thisrepo_age = repo_config_age
diff --git a/yum/misc.py b/yum/misc.py
index c322c76..409071c 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -514,7 +514,7 @@ def getCacheDir(tmpdir='/var/tmp'):
     # check for /var/tmp/yum-username-* - 
     prefix = 'yum-%s-' % username    
     dirpath = '%s/%s*' % (tmpdir, prefix)
-    cachedirs = glob.glob(dirpath)
+    cachedirs = sorted(glob.glob(dirpath))
     
     for thisdir in cachedirs:
         stats = os.lstat(thisdir)
@@ -618,7 +618,7 @@ def get_running_kernel_version_release(ts):
             
     # we've got nothing so far, so... we glob for the file that MIGHT have
     # this kernels and then look up the file in our rpmdb
-    fns = glob.glob('/boot/vmlinuz*%s*' % ver)
+    fns = sorted(glob.glob('/boot/vmlinuz*%s*' % ver))
     for fn in fns:
         mi = ts.dbMatch('basenames', fn)
         for h in mi:
diff --git a/yum/plugins.py b/yum/plugins.py
index 287fba7..6d7c529 100644
--- a/yum/plugins.py
+++ b/yum/plugins.py
@@ -193,7 +193,7 @@ class YumPlugins:
         for dir in self.searchpath:
             if not os.path.isdir(dir):
                 continue
-            for modulefile in glob.glob('%s/*.py' % dir):
+            for modulefile in sorted(glob.glob('%s/*.py' % dir)):
                 self._loadplugin(modulefile, types)
 
         if self._plugins:


More information about the Yum-commits mailing list