2016-04-05 01:01:19 +00:00
|
|
|
From adbdc84c60045ca647a739a0818a6f46347772d7 Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
|
|
|
|
<marmarek@invisiblethingslab.com>
|
|
|
|
Date: Fri, 7 Aug 2015 03:39:17 +0200
|
|
|
|
Subject: [PATCH 1/2] Set repository gpgkey option
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Organization: Invisible Things Lab
|
|
|
|
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
|
|
|
|
2013-01-26 21:41:55 +00:00
|
|
|
Handle "repo --gpgkey" in kickstart to verify downloaded packages
|
|
|
|
|
2016-04-05 01:01:19 +00:00
|
|
|
Especially important for lorax - packages will not verified there in
|
|
|
|
any way without setting yum options here.
|
|
|
|
|
|
|
|
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
|
|
|
---
|
|
|
|
pungi/gather.py | 13 ++++++++++---
|
|
|
|
1 file changed, 10 insertions(+), 3 deletions(-)
|
2013-01-26 21:41:55 +00:00
|
|
|
|
2016-04-05 01:01:19 +00:00
|
|
|
diff --git a/pungi/gather.py b/pungi/gather.py
|
|
|
|
index bcc2861..a5c9df9 100644
|
|
|
|
--- a/pungi/gather.py
|
|
|
|
+++ b/pungi/gather.py
|
|
|
|
@@ -281,7 +281,7 @@ class Pungi(PungiBase):
|
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
|
2016-04-05 01:01:19 +00:00
|
|
|
@@ -318,6 +318,10 @@ class Pungi(PungiBase):
|
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
|
2016-04-05 01:01:19 +00:00
|
|
|
@@ -349,6 +353,7 @@ class Pungi(PungiBase):
|
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()
|
2016-04-05 01:01:19 +00:00
|
|
|
@@ -379,7 +384,8 @@ class Pungi(PungiBase):
|
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,
|
2016-04-05 01:01:19 +00:00
|
|
|
@@ -387,7 +393,8 @@ class Pungi(PungiBase):
|
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)
|
2016-04-05 01:01:19 +00:00
|
|
|
--
|
|
|
|
2.1.0
|
|
|
|
|