2013-01-26 21:41:55 +00:00
|
|
|
Handle "repo --gpgkey" in kickstart to verify downloaded packages
|
|
|
|
|
|
|
|
Especially important for lorax - they will not verified in any way without
|
|
|
|
setting yum options here.
|
|
|
|
|
|
|
|
Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
|
2014-04-07 23:05:12 +00:00
|
|
|
Index: pungi-3.03/src/pypungi/__init__.py
|
2013-01-26 21:41:55 +00:00
|
|
|
===================================================================
|
2014-04-07 23:05:12 +00:00
|
|
|
--- pungi-3.03.orig/src/pypungi/__init__.py
|
|
|
|
+++ pungi-3.03/src/pypungi/__init__.py
|
|
|
|
@@ -242,7 +242,7 @@
|
2013-01-26 21:41:55 +00:00
|
|
|
|
|
|
|
def _add_yum_repo(self, name, url, mirrorlist=False, groups=True,
|
2014-04-07 23:05:12 +00:00
|
|
|
cost=1000, includepkgs=None, excludepkgs=None,
|
2013-01-26 21:41:55 +00:00
|
|
|
- proxy=None):
|
|
|
|
+ proxy=None, gpgkey=None):
|
|
|
|
"""This function adds a repo to the yum object.
|
|
|
|
name: Name of the repo
|
2014-04-07 23:05:12 +00:00
|
|
|
url: Full url to the repo
|
|
|
|
@@ -279,6 +279,10 @@
|
2013-01-26 21:41:55 +00:00
|
|
|
thisrepo.exclude = excludepkgs
|
|
|
|
thisrepo.includepkgs = includepkgs
|
|
|
|
thisrepo.cost = cost
|
|
|
|
+ if gpgkey:
|
|
|
|
+ thisrepo.gpgcheck = True
|
|
|
|
+ thisrepo.gpgkey = yum.parser.varReplace(gpgkey,
|
|
|
|
+ self.ayum.conf.yumvar)
|
|
|
|
# Yum doesn't like proxy being None
|
|
|
|
if proxy:
|
|
|
|
thisrepo.proxy = proxy
|
2014-04-07 23:05:12 +00:00
|
|
|
@@ -309,6 +313,7 @@
|
2013-01-26 21:41:55 +00:00
|
|
|
yumconf.installroot = os.path.join(self.workdir, 'yumroot')
|
|
|
|
yumconf.uid = os.geteuid()
|
|
|
|
yumconf.cache = 0
|
|
|
|
+ yumconf.assumeyes = True
|
|
|
|
yumconf.failovermethod = 'priority'
|
2014-04-07 23:05:12 +00:00
|
|
|
yumconf.deltarpm = 0
|
2013-01-26 21:41:55 +00:00
|
|
|
yumvars = yum.config._getEnvVar()
|
2014-04-07 23:05:12 +00:00
|
|
|
@@ -339,7 +344,8 @@
|
2013-01-26 21:41:55 +00:00
|
|
|
cost=repo.cost,
|
|
|
|
includepkgs=repo.includepkgs,
|
|
|
|
excludepkgs=repo.excludepkgs,
|
|
|
|
- proxy=repo.proxy)
|
|
|
|
+ proxy=repo.proxy,
|
|
|
|
+ gpgkey=repo.gpgkey)
|
|
|
|
else:
|
|
|
|
self._add_yum_repo(repo.name, repo.baseurl,
|
|
|
|
mirrorlist=False,
|
2014-04-07 23:05:12 +00:00
|
|
|
@@ -347,7 +353,8 @@
|
2013-01-26 21:41:55 +00:00
|
|
|
cost=repo.cost,
|
|
|
|
includepkgs=repo.includepkgs,
|
|
|
|
excludepkgs=repo.excludepkgs,
|
|
|
|
- proxy=repo.proxy)
|
|
|
|
+ proxy=repo.proxy,
|
|
|
|
+ gpgkey=repo.gpgkey)
|
2014-04-07 23:05:12 +00:00
|
|
|
|
|
|
|
self.logger.info('Getting sacks for arches %s' % self.valid_arches)
|
|
|
|
self.ayum._getSacks(archlist=self.valid_arches)
|