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

James Antill james at and.org
Tue Oct 13 16:12:52 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 :).
---
 yum/__init__.py |    7 +++++++
 yum/config.py   |    2 +-
 yum/repos.py    |    1 +
 yum/yumRepo.py  |    1 +
 4 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index 6af81b8..f4edeb7 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1050,6 +1050,13 @@ class YumBase(depsolve.Depsolve):
 
         self.plugins.run('pretrans')
 
+        #  We may want to put this other places, eventually, but for now it's
+        # good as long as we get it right for history.
+        for repo in self.repos.listEnabled():
+            if repo._xml2sqlite_local:
+                self.run_with_package_names.add('yum-metadata-parser')
+                break
+
         using_pkgs_pats = list(self.run_with_package_names)
         using_pkgs = self.rpmdb.returnPackages(patterns=using_pkgs_pats)
         rpmdbv  = self.rpmdb.simpleVersion(main_only=True)[0]
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..7d35612 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -285,6 +285,7 @@ class Repository:
         self.id = repoid
         self.quick_enable_disable = {}
         self.disable()
+        self._xml2sqlite_local = False
 
     def __cmp__(self, other):
         """ Sort base class repos. by alphanumeric on their id, also
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 006f410..64b175e 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._xml2sqlite_local = True
                 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