---
cli.py | 9 ++++-----
yum/__init__.py | 7 ++++++-
yum/repos.py | 2 ++
yum/yumRepo.py | 2 +-
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/cli.py b/cli.py
index 88d8c07..06bfb68 100644
--- a/cli.py
+++ b/cli.py
@@ -1497,12 +1497,11 @@ class YumOptionParser(OptionParser):
# Disable all gpg key checking, if requested.
if opts.nogpgcheck:
- self.base.conf.gpgcheck = False
- self.base.conf.repo_gpgcheck = False
- self.base.conf.localpkg_gpgcheck = False
+ # Altering the normal configs. doesn't work too well, esp.
with
+ # regard to dynamically enabled repos.
+ self._override_sigchecks = True
for repo in self.base.repos.listEnabled():
- repo.gpgcheck = False
- repo.repo_gpgcheck = False
+ repo._override_sigchecks = True
except ValueError, e:
self.logger.critical(_('Options Error: %s'), e)
diff --git a/yum/__init__.py b/yum/__init__.py
index 92fa0d0..5572960 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -199,6 +199,8 @@ class YumBase(depsolve.Depsolve):
self.run_with_package_names = set()
+ self._override_sigchecks = False
+
def __del__(self):
self.close()
self.closeRpmDB()
@@ -2009,7 +2011,10 @@ class YumBase(depsolve.Depsolve):
might help.
- 2 - Fatal GPG verification error, give up.
'''
- if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
+ if self._override_sigchecks:
+ check = False
+ hasgpgkey = 0
+ elif hasattr(po, 'pkgtype') and po.pkgtype == 'local':
check = self.conf.localpkg_gpgcheck
hasgpgkey = 0
else:
diff --git a/yum/repos.py b/yum/repos.py
index 4b74ac6..4803a7f 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -63,6 +63,8 @@ class RepoStorage:
self._cache_enabled_repos = []
self.quick_enable_disable = {}
+ self._override_sigchecks = ayum._override_sigchecks
+
def doSetup(self, thisrepo = None):
self.ayum.plugins.run('prereposetup')
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index b0e23c6..a920db9 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -1434,7 +1434,7 @@ class YumRepository(Repository, config.RepoConf):
else:
filepath = fo
- if self.repo_gpgcheck:
+ if self.repo_gpgcheck and not self._override_sigchecks:
if misc.gpgme is None:
raise URLGrabError(-1, 'pygpgme is not working so repomd.xml
can not be verified for %s' % (self))
--
1.7.2.3
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel