[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/rpmsack.py
James Antill
james at osuosl.org
Fri Feb 19 13:57:00 UTC 2010
yum/rpmsack.py | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 53786205498c0160ca5e7e16a794106746f54ae9
Merge: cab9068... 4544bfd...
Author: James Antill <james at and.org>
Date: Fri Feb 19 08:56:55 2010 -0500
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:
l10n: Updates to Spanish (Castilian) (es) translation
commit cab9068b4b184af3f306c246b1c2bd46b925c28c
Author: James Antill <james at and.org>
Date: Fri Feb 19 07:58:39 2010 -0500
Don't preload all the package paths for yumdb on init. Moved to function.
This is fine as _get_dir_name will still do it manually, and the only
thing that needs to know more is sync_with_rpmdb ... and that can call
_load_all_package_paths(self) when it gets written.
This does a _lot_ of open/stat calls, so is really noticable if the
yumdb isn't in cache.
diff --git a/yum/rpmsack.py b/yum/rpmsack.py
index 83b684e..adf70af 100644
--- a/yum/rpmsack.py
+++ b/yum/rpmsack.py
@@ -1200,7 +1200,10 @@ class RPMDBAdditionalData(object):
else:
if os.access(self.conf.db_path, os.W_OK):
self.conf.writable = True
+ # Don't call _load_all_package_paths to preload, as it's expensive
+ # if the dirs. aren't in cache.
+ def _load_all_package_paths(self):
# glob the path and get a dict of pkgs to their subdir
glb = '%s/*/*/' % self.conf.db_path
pkgdirs = glob.glob(glb)
More information about the Yum-commits
mailing list