Skip to content

Commit

Permalink
Merge pull request #1375 from Vogtinator/kiwiprefer
Browse files Browse the repository at this point in the history
Fix --prefer-pkgs for noinstall="1" packages in kiwi builds
  • Loading branch information
dmach authored Aug 7, 2023
2 parents b8f10a1 + 4d432b6 commit e3149fb
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,10 +1269,24 @@ def __str__(self):
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?
Expand Down

0 comments on commit e3149fb

Please sign in to comment.