[master 1/2] Add support for "repo --gpgkey" kickstart option

marmarek installerbot-noreply at redhat.com
Tue Sep 29 12:37:58 UTC 2015


From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
 <marmarek at invisiblethingslab.com>

This adds ability to verify gpg signatures on downloaded packages, which is
especially important when installing from network repository (instead of local
DVD/disk).

This change depends on pykickstart support here:
https://github.com/rhinstaller/pykickstart/pull/32
---
 pyanaconda/kickstart.py            | 4 ++--
 pyanaconda/packaging/dnfpayload.py | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 4fead23..3c6bfc4 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -1575,7 +1575,7 @@ def execute(self, storage, ksdata, instClass):
                                      parents=request)
             storage.createDevice(luksdev)
 
-class RepoData(commands.repo.F21_RepoData):
+class RepoData(commands.repo.F23_RepoData):
     def __init__(self, *args, **kwargs):
         """ Add enabled kwarg
 
@@ -1585,7 +1585,7 @@ def __init__(self, *args, **kwargs):
         self.enabled = kwargs.pop("enabled", True)
         self.repo_id = kwargs.pop("repo_id", None)
 
-        commands.repo.F21_RepoData.__init__(self, *args, **kwargs)
+        commands.repo.F23_RepoData.__init__(self, *args, **kwargs)
 
 class ReqPart(commands.reqpart.F23_ReqPart):
     def execute(self, storage, ksdata, instClass):
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index db49d66..7d4dffb 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -269,6 +269,10 @@ def _add_repo(self, ksrepo):
         if ksrepo.excludepkgs:
             repo.exclude = ksrepo.excludepkgs
 
+        if ksrepo.gpgkey:
+            repo.gpgkey = ksrepo.gpgkey
+            repo.gpgcheck = True
+
         # If this repo is already known, it's one of two things:
         # (1) The user is trying to do "repo --name=updates" in a kickstart file
         #     and we should just know to enable the already existing on-disk


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/ad0598e69521cf203b1fa53b01a6eb8b79025e93


More information about the anaconda-patches mailing list