mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
Check if buildopts.get_rpm_whitelist() is really set before using it.
This fixes module builds which sets the `buildopts` for something else than the RPM whitelist. Before this commit, when `buildopts` was set, the RPM whitelist was always taken from the buildopts even if it was not defined there. This resulted in empty `rpm_whitelist` and therefore no pkglist set in Koji tag. In this commit, MBS uses whitelist from `buildopts` only if it is really set by the module maintainer.
This commit is contained in:
@@ -531,7 +531,7 @@ class KojiModuleBuilder(GenericBuilder):
|
||||
self.tag_name + "-build", self.arches, perm="admin")
|
||||
|
||||
buildopts = self.mmd.get_buildopts()
|
||||
if buildopts:
|
||||
if buildopts and buildopts.get_rpm_whitelist():
|
||||
rpm_whitelist = buildopts.get_rpm_whitelist()
|
||||
else:
|
||||
rpm_whitelist = self.components
|
||||
|
||||
@@ -487,6 +487,14 @@ class TestKojiBuilder:
|
||||
opts.add_rpm_to_whitelist("custom2")
|
||||
mmd.set_buildopts(opts)
|
||||
self.module.modulemd = mmd_to_str(mmd)
|
||||
else:
|
||||
# Set some irrelevant buildopts options to test that KojiModuleBuilder
|
||||
# is not confused by this.
|
||||
mmd = self.module.mmd()
|
||||
opts = Modulemd.Buildopts()
|
||||
opts.set_rpm_macros("%my_macro 1")
|
||||
mmd.set_buildopts(opts)
|
||||
self.module.modulemd = mmd_to_str(mmd)
|
||||
|
||||
if repo_include_all is False:
|
||||
mmd = self.module.mmd()
|
||||
|
||||
Reference in New Issue
Block a user