[Yum-devel] [PATCH] Do not add pkgtags if not available.

Zdeněk Pavlas zpavlas at redhat.com
Thu Dec 1 13:44:46 UTC 2011


This prevents a sqlite exception and a yum traceback
when using 'yum search -C'.
---
 yum/__init__.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index f936fae..33c275e 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -924,7 +924,8 @@ class YumBase(depsolve.Depsolve):
                                                            'pkgtags.sqlite',
                                                            cached=repo.cache)
                     # feed it into _tags.add()
-                    self._tags.add(repo.id, tag_sqlite)
+                    if os.path.exists(tag_sqlite):
+                        self._tags.add(repo.id, tag_sqlite)
                 except (Errors.RepoError, Errors.PkgTagsError), e:
                     msg = _('Failed to add Pkg Tags for repository: %s - %s') % (repo, str(e))
                     self.logger.critical(msg)
-- 
1.7.4.4



More information about the Yum-devel mailing list