Reduces code duplication and unnecessary rpmdb reopens. The rpmdb
gets opened shortly afterwards anyway and closed before any downloads
so there should be no unwanted side-effects.
---
yum/__init__.py | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/yum/__init__.py b/yum/__init__.py
index c160201..d764bf4 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2962,14 +2962,7 @@ class YumBase(depsolve.Depsolve):
if os.path.exists(gpgkeyschecked):
return 1
- myts =
rpmUtils.transaction.initReadOnlyTransaction(root=self.conf.installroot)
- myts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
- idx = myts.dbMatch('name', 'gpg-pubkey')
- keys = idx.count()
- del idx
- del myts
-
- if keys == 0:
+ if not self.rpmdb.returnGPGPubkeyPackages():
return 0
else:
mydir = os.path.dirname(gpgkeyschecked)
--
1.7.4
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel