parent
6292e1b4de
commit
dd2a3cd647
@ -1,35 +0,0 @@
|
||||
From 18bbb5b21d4da8120fb9f3193248dd6faa915222 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Kopecek <tkopecek@redhat.com>
|
||||
Date: Oct 17 2022 12:39:48 +0000
|
||||
Subject: fix include path
|
||||
|
||||
|
||||
Related: https://pagure.io/koji/issue/3553
|
||||
|
||||
---
|
||||
|
||||
diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py
|
||||
index 42aa707..abb5511 100644
|
||||
--- a/plugins/builder/kiwi.py
|
||||
+++ b/plugins/builder/kiwi.py
|
||||
@@ -197,16 +197,17 @@ class KiwiCreateImageTask(BaseBuildTask):
|
||||
for inc_node in image.getElementsByTagName('include'):
|
||||
path = inc_node.getAttribute('from')
|
||||
if path.startswith('this://'):
|
||||
- path = koji.util.joinpath(desc_path, path[7:])
|
||||
+ path = koji.util.joinpath(os.path.dirname(desc_path), path[7:])
|
||||
else:
|
||||
# we want to reject other protocols, e.g. file://, https://
|
||||
# reachingoutside of repo
|
||||
raise koji.GenericError(f"Unhandled include protocol in include path: {path}.")
|
||||
inc = xml.dom.minidom.parse(path) # nosec
|
||||
# every included xml has image root element again
|
||||
- for node in inc.getElementsByTagName('image').childNodes:
|
||||
+ for node in list(inc.getElementsByTagName('image')[0].childNodes):
|
||||
if node.nodeName != 'repository':
|
||||
image.appendChild(node)
|
||||
+ image.removeChild(inc_node)
|
||||
|
||||
# remove remaining old repos
|
||||
for old_repo in image.getElementsByTagName('repository'):
|
||||
|
@ -1,155 +0,0 @@
|
||||
From e6a9553e9c5850c8c1b9361f84f2f9dbb426ef4c Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Kopecek <tkopecek@redhat.com>
|
||||
Date: Oct 25 2022 10:25:49 +0000
|
||||
Subject: kiwi: propagate --type option
|
||||
|
||||
|
||||
Related: https://pagure.io/koji/issue/3556
|
||||
|
||||
---
|
||||
|
||||
diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py
|
||||
index 42aa707..7d6f6e7 100644
|
||||
--- a/plugins/builder/kiwi.py
|
||||
+++ b/plugins/builder/kiwi.py
|
||||
@@ -325,11 +325,11 @@ class KiwiCreateImageTask(BaseBuildTask):
|
||||
'user_id': self.taskinfo['owner'],
|
||||
'channel': self.session.getChannel(self.taskinfo['channel_id'],
|
||||
strict=True)['name'],
|
||||
- 'scratch': self.opts.get('scratch')
|
||||
+ 'scratch': self.opts.get('scratch', False)
|
||||
})
|
||||
logfile = os.path.join(self.workdir, 'checkout-%s.log' % arch)
|
||||
self.run_callbacks('preSCMCheckout', scminfo=scm.get_info(),
|
||||
- build_tag=build_tag, scratch=self.opts.get('scratch'))
|
||||
+ build_tag=build_tag, scratch=self.opts.get('scratch', False))
|
||||
scmdir = broot.tmpdir()
|
||||
koji.ensuredir(scmdir)
|
||||
scmsrcdir = scm.checkout(scmdir, self.session,
|
||||
@@ -337,7 +337,7 @@ class KiwiCreateImageTask(BaseBuildTask):
|
||||
self.run_callbacks("postSCMCheckout",
|
||||
scminfo=scm.get_info(),
|
||||
build_tag=build_tag,
|
||||
- scratch=self.opts.get('scratch'),
|
||||
+ scratch=self.opts.get('scratch', False),
|
||||
srcdir=scmsrcdir)
|
||||
|
||||
# user repos
|
||||
@@ -365,6 +365,8 @@ class KiwiCreateImageTask(BaseBuildTask):
|
||||
cmd = ['kiwi-ng']
|
||||
if self.opts.get('profile'):
|
||||
cmd.extend(['--profile', self.opts['profile']])
|
||||
+ if self.opts.get('type'):
|
||||
+ cmd.extend(['--type', self.opts['type']])
|
||||
target_dir = '/builddir/result/image'
|
||||
cmd.extend([
|
||||
'--kiwi-file', os.path.basename(desc), # global option for image/system commands
|
||||
diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py
|
||||
index 8786b13..07125d7 100644
|
||||
--- a/plugins/cli/kiwi.py
|
||||
+++ b/plugins/cli/kiwi.py
|
||||
@@ -27,6 +27,7 @@ def handle_kiwi_build(goptions, session, args):
|
||||
help="Do not display progress of the upload")
|
||||
parser.add_option("--kiwi-profile", action="store", default=None,
|
||||
help="Select profile from description file")
|
||||
+ parser.add_option("--type", help="Override default build type from description")
|
||||
parser.add_option("--make-prep", action="store_true", default=False,
|
||||
help="Run 'make prep' in checkout before starting the build")
|
||||
parser.add_option("--can-fail", action="store", dest="optional_arches",
|
||||
@@ -46,28 +47,33 @@ def handle_kiwi_build(goptions, session, args):
|
||||
target, scm, path = args
|
||||
|
||||
activate_session(session, goptions)
|
||||
-
|
||||
kwargs = {
|
||||
- 'scratch': options.scratch,
|
||||
- 'optional_arches': [canonArch(arch)
|
||||
- for arch in options.optional_arches.split(',')
|
||||
- if arch],
|
||||
- 'profile': options.kiwi_profile,
|
||||
- 'release': options.release,
|
||||
- 'make_prep': options.make_prep,
|
||||
+ 'arches': [],
|
||||
+ 'target': target,
|
||||
+ 'desc_url': scm,
|
||||
+ 'desc_path': path,
|
||||
}
|
||||
-
|
||||
- arches = []
|
||||
+ if options.scratch:
|
||||
+ kwargs['scratch'] = True
|
||||
+ if options.optional_arches:
|
||||
+ kwargs['optional_arches'] = [
|
||||
+ canonArch(arch)
|
||||
+ for arch in options.optional_arches.split(',')
|
||||
+ if arch]
|
||||
+ if options.kiwi_profile:
|
||||
+ kwargs['profile'] = options.kiwi_profile,
|
||||
+ if options.release:
|
||||
+ kwargs['release'] = options.release
|
||||
+ if options.make_prep:
|
||||
+ kwargs['make_prep'] = True
|
||||
+ if options.type:
|
||||
+ kwargs['type'] = options.type
|
||||
if options.arches:
|
||||
- arches = [canonArch(arch) for arch in options.arches]
|
||||
+ kwargs['arches'] = [canonArch(arch) for arch in options.arches]
|
||||
+ if options.repo:
|
||||
+ kwargs['repos'] = options.repo
|
||||
|
||||
- task_id = session.kiwiBuild(
|
||||
- target=target,
|
||||
- arches=arches,
|
||||
- desc_url=scm,
|
||||
- desc_path=path,
|
||||
- repos=options.repo,
|
||||
- **kwargs)
|
||||
+ task_id = session.kiwiBuild(**kwargs)
|
||||
|
||||
if not goptions.quiet:
|
||||
print("Created task: %d" % task_id)
|
||||
diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py
|
||||
index 79da38a..17b8e8e 100644
|
||||
--- a/plugins/hub/kiwi.py
|
||||
+++ b/plugins/hub/kiwi.py
|
||||
@@ -16,7 +16,8 @@ koji.tasks.LEGACY_SIGNATURES['createKiwiImage'] = [
|
||||
|
||||
@export
|
||||
def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile=None,
|
||||
- scratch=False, priority=None, make_prep=False, repos=None, release=None):
|
||||
+ scratch=False, priority=None, make_prep=False, repos=None, release=None,
|
||||
+ type=None):
|
||||
context.session.assertPerm('image')
|
||||
for i in [desc_url, desc_path, profile, release]:
|
||||
if i is not None:
|
||||
@@ -42,14 +43,21 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile
|
||||
'only admins may create high-priority tasks')
|
||||
taskOpts['priority'] = koji.PRIO_DEFAULT + priority
|
||||
|
||||
- opts = {
|
||||
- 'optional_arches': optional_arches,
|
||||
- 'profile': profile,
|
||||
- 'scratch': bool(scratch),
|
||||
- 'release': release,
|
||||
- 'repos': repos or [],
|
||||
- 'make_prep': bool(make_prep),
|
||||
- }
|
||||
+ opts = {}
|
||||
+ if scratch:
|
||||
+ opts['scratch'] = True
|
||||
+ if profile:
|
||||
+ opts['profile'] = profile
|
||||
+ if release:
|
||||
+ opts['release'] = release
|
||||
+ if optional_arches:
|
||||
+ opts['optional_arches'] = optional_arches,
|
||||
+ if repos:
|
||||
+ opts['repos'] = repos
|
||||
+ if make_prep:
|
||||
+ opts['make_prep'] = True
|
||||
+ if type:
|
||||
+ opts['type'] = type
|
||||
return kojihub.make_task('kiwiBuild',
|
||||
[target, arches, desc_url, desc_path, opts],
|
||||
**taskOpts)
|
||||
|
@ -1 +1 @@
|
||||
SHA512 (koji-1.30.1.tar.bz2) = d5b0ca21c8f09a6346273c449f643a93a1edaabea82ea6d19aeba057c1d770c980f28545f42cb6bb2f28e8e20784b7c7c65f4bf2ce4957138f86bbab7925ee4b
|
||||
SHA512 (koji-1.31.0.tar.bz2) = 8be8e72182f1c33dea7d308708f71a9c6bcfe896348c1ccc640a07a216070cb0951ee8dfc103897239a687dbd54c5544bc29cbb15ca09083852e3aa428f03887
|
||||
|
Loading…
Reference in new issue