[Yum-devel] [PATCH] Remove yum-metadata-parser from the default run_with_package_names list

James Antill james at and.org
Tue Oct 13 15:55:12 UTC 2009


 We now add it conditionally if we are using any repos. with .xml only
MD.

 This means it isn't logged every time in history (apart from if you
have the adobe repo. enabled :).

 Also adding it is a slight layer violation ... but I can't think of a
better way of doing it.
---
 yum/config.py  |    2 +-
 yum/repos.py   |    3 +++
 yum/yumRepo.py |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/yum/config.py b/yum/config.py
index 248d84b..2ae7e89 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -704,7 +704,7 @@ class YumConf(StartupConf):
     sslclientkey = Option()
 
     history_record = BoolOption(True)
-    history_record_packages = ListOption(['yum', 'rpm', 'yum-metadata-parser'])
+    history_record_packages = ListOption(['yum', 'rpm'])
 
     _reposlist = []
 
diff --git a/yum/repos.py b/yum/repos.py
index 32d3426..865fd8f 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -96,6 +96,9 @@ class RepoStorage:
         if self.repos.has_key(repoobj.id):
             raise Errors.DuplicateRepoError, 'Repository %s is listed more than once in the configuration' % (repoobj.id)
         self.repos[repoobj.id] = repoobj
+        #  We need to get at this, so if we use a .xml repo. we add yum-m-p to
+        # this list.
+        repoobj._run_with_package_names = self.ayum.run_with_package_names
         if hasattr(repoobj, 'quick_enable_disable'):
             self.quick_enable_disable.update(repoobj.quick_enable_disable)
             repoobj.quick_enable_disable = self.quick_enable_disable
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 006f410..bed7404 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -180,6 +180,7 @@ class YumPackageSack(packageSack.PackageSack):
                 dobj = repo.cacheHandler.open_database(db_un_fn)
 
             else:
+                repo._run_with_package_names.add('yum-metadata-parser')
                 xml = repo_get_function()
                 xmldata = repo.repoXML.getData(mymdtype)
                 (ctype, csum) = xmldata.checksum
-- 
1.6.2.5



More information about the Yum-devel mailing list