1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-05 23:23:39 +02:00

Merge pull request #1375 from Vogtinator/kiwiprefer

Fix --prefer-pkgs for noinstall="1" packages in kiwi builds
This commit is contained in:
2023-08-07 10:27:08 +02:00
committed by GitHub

View File

@@ -1269,10 +1269,24 @@ def main(apiurl, store, opts, argv):
if name == filename:
print("Using prefered package: " + path + "/" + filename)
os.unlink(tffn)
if opts.linksources:
os.link(path + "/" + filename, tffn)
else:
os.symlink(path + "/" + filename, tffn)
if prefer_pkgs:
localpkgdir = "repos/_local/"
os.mkdir(localpkgdir)
buildargs.append("--kiwi-parameter")
buildargs.append("--add-repo")
buildargs.append("--kiwi-parameter")
buildargs.append(f"dir://./{localpkgdir}")
buildargs.append("--kiwi-parameter")
buildargs.append("--add-repotype")
buildargs.append("--kiwi-parameter")
buildargs.append("rpm-md")
for name, path in prefer_pkgs.items():
tffn = os.path.join(localpkgdir, os.path.basename(path))
if opts.linksources:
os.link(path, tffn)
else:
os.symlink(path, tffn)
if build_type == 'kiwi':
# Is a obsrepositories tag used?