2017-01-09 03:13:42 +00:00
|
|
|
From 49598dab042e2f9f0d5697786f3c6bf687709277 Mon Sep 17 00:00:00 2001
|
2016-04-21 00:29:09 +00:00
|
|
|
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
|
|
|
|
<marmarek@invisiblethingslab.com>
|
|
|
|
Date: Thu, 21 Apr 2016 02:15:54 +0200
|
2017-01-09 03:13:42 +00:00
|
|
|
Subject: [PATCH 1/3] Allow specify gpg key for a repository
|
2016-04-21 00:29:09 +00:00
|
|
|
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>
|
|
|
|
|
|
|
|
Quite hacky way, but current command line syntax doesn't support
|
|
|
|
additional per-repository settings.
|
|
|
|
|
|
|
|
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
|
|
|
---
|
2017-01-09 03:13:42 +00:00
|
|
|
src/pylorax/cmdline.py | 4 ++--
|
|
|
|
src/sbin/lorax | 10 ++++++++++
|
|
|
|
2 files changed, 12 insertions(+), 2 deletions(-)
|
2016-04-21 00:29:09 +00:00
|
|
|
|
2017-01-09 03:13:42 +00:00
|
|
|
diff --git a/src/pylorax/cmdline.py b/src/pylorax/cmdline.py
|
|
|
|
index 69b6ccb..855d9f3 100644
|
|
|
|
--- a/src/pylorax/cmdline.py
|
|
|
|
+++ b/src/pylorax/cmdline.py
|
|
|
|
@@ -41,7 +41,7 @@ def lorax_parser():
|
|
|
|
required.add_argument("-p", "--product", help="product name", required=True, metavar="PRODUCT")
|
|
|
|
required.add_argument("-v", "--version", help="version identifier", required=True, metavar="VERSION")
|
|
|
|
required.add_argument("-r", "--release", help="release information", required=True, metavar="RELEASE")
|
2016-04-21 00:29:09 +00:00
|
|
|
- required.add_argument("-s", "--source", help="source repository (may be listed multiple times)",
|
|
|
|
+ required.add_argument("-s", "--source", help="source repository (may be listed multiple times), append gpgkey URL in brackets to enable package verification",
|
2017-01-09 03:13:42 +00:00
|
|
|
metavar="REPOSITORY", action="append", default=[])
|
|
|
|
required.add_argument("--repo", help="source dnf repository file", type=os.path.abspath,
|
|
|
|
dest="repos", metavar="REPOSITORY", action="append", default=[])
|
|
|
|
@@ -49,7 +49,7 @@ def lorax_parser():
|
2016-04-21 00:29:09 +00:00
|
|
|
# optional arguments
|
|
|
|
optional = parser.add_argument_group("optional arguments")
|
|
|
|
optional.add_argument("-m", "--mirrorlist",
|
|
|
|
- help="mirrorlist repository (may be listed multiple times)",
|
|
|
|
+ help="mirrorlist repository (may be listed multiple times), append gpgkey URL in brackets to enable package verification",
|
|
|
|
metavar="REPOSITORY", action="append", default=[])
|
|
|
|
optional.add_argument("-t", "--variant",
|
2017-01-09 03:13:42 +00:00
|
|
|
help="variant name", metavar="VARIANT")
|
|
|
|
diff --git a/src/sbin/lorax b/src/sbin/lorax
|
|
|
|
index df4994d..12061b4 100755
|
|
|
|
--- a/src/sbin/lorax
|
|
|
|
+++ b/src/sbin/lorax
|
|
|
|
@@ -212,6 +212,11 @@ def get_dnf_base_object(installroot, sources, mirrorlists=None, repos=None,
|
2016-04-21 00:29:09 +00:00
|
|
|
continue
|
|
|
|
repo_name = "lorax-repo-%d" % i
|
|
|
|
repo = dnf.repo.Repo(repo_name, cachedir)
|
|
|
|
+ if '(' in r and ')' in r:
|
|
|
|
+ assert r[-1] == ')'
|
|
|
|
+ r, gpgkey = r[:-1].split('(')
|
|
|
|
+ repo.gpgkey = [gpgkey]
|
|
|
|
+ repo.gpgcheck = True
|
|
|
|
repo.baseurl = [r]
|
|
|
|
if proxy:
|
|
|
|
repo.proxy = proxy
|
2017-01-09 03:13:42 +00:00
|
|
|
@@ -232,6 +237,11 @@ def get_dnf_base_object(installroot, sources, mirrorlists=None, repos=None,
|
2016-04-21 00:29:09 +00:00
|
|
|
continue
|
|
|
|
repo_name = "lorax-mirrorlist-%d" % i
|
|
|
|
repo = dnf.repo.Repo(repo_name, cachedir)
|
|
|
|
+ if '(' in r and ')' in r:
|
|
|
|
+ assert r[-1] == ')'
|
|
|
|
+ r, gpgkey = r[:-1].split('(')
|
|
|
|
+ repo.gpgkey = [gpgkey]
|
|
|
|
+ repo.gpgcheck = True
|
|
|
|
repo.mirrorlist = r
|
|
|
|
if proxy:
|
|
|
|
repo.proxy = proxy
|
|
|
|
--
|
2017-01-09 03:13:42 +00:00
|
|
|
2.7.4
|
2016-04-21 00:29:09 +00:00
|
|
|
|