From f3d07eab3f5c0676bac1106bfcbb6441b2705c85 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Wed, 20 May 2020 11:33:07 +0200 Subject: [PATCH] Fix kiwi build with --prefer-pkgs The buildinfo contains packages from the local dir, so it needs the list of local packages to work correctly. --- osc/build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osc/build.py b/osc/build.py index 7d2b8e6a..b20ef3f4 100644 --- a/osc/build.py +++ b/osc/build.py @@ -508,8 +508,7 @@ def check_trusted_projects(apiurl, projects): config['api_host_options'][apiurl]['trusted_prj'] = trusted conf.config_set_option(apiurl, 'trusted_prj', ' '.join(trusted)) -def get_kiwipath_from_buildinfo(apiurl, bi_filename, prj, repo): - bi = Buildinfo(bi_filename, apiurl, 'kiwi') +def get_kiwipath_from_buildinfo(bi, prj, repo): # If the project does not have a path defined we need to get the config # via the repositories in the kiwi file. Unfortunately the buildinfo # does not include a hint if this is the case, so we rely on a heuristic @@ -866,7 +865,8 @@ def main(apiurl, opts, argv): bi_file.flush() kiwipath = None if build_type == 'kiwi': - kiwipath = get_kiwipath_from_buildinfo(apiurl, bi_filename, prj, repo) + bi = Buildinfo(bi_filename, apiurl, 'kiwi', list(prefer_pkgs.keys())) + kiwipath = get_kiwipath_from_buildinfo(bi, prj, repo) bc = get_buildconfig(apiurl, prj, repo, kiwipath) bc_file.seek(0) bc_file.write(decode_it(bc))