1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

Merge pull request #1375 from Vogtinator/kiwiprefer

Fix --prefer-pkgs for noinstall="1" packages in kiwi builds
This commit is contained in:
Daniel Mach 2023-08-07 10:27:08 +02:00 committed by GitHub
commit e3149fb478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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?