1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-10-16 21:52:51 +02:00

fix broken prefer_pkgs logic

osc build -p <dir> and osc buildinfo -p <dir> is now working
again. Root cause was the switch from cpio.py and RPMQuery to
a bytes only interface
This commit is contained in:
lethliel
2019-02-20 11:14:46 +01:00
parent 7dba86ce41
commit f8c70a1525
5 changed files with 27 additions and 24 deletions

View File

@@ -5798,7 +5798,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
build_descr_data = None
if not build_descr is None:
build_descr_data = open(build_descr, 'r').read()
build_descr_data = open(build_descr, 'rb').read()
if opts.prefer_pkgs and build_descr_data is None:
raise oscerr.WrongArgs('error: a build description is needed if \'--prefer-pkgs\' is used')
elif opts.prefer_pkgs:
@@ -5809,7 +5809,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
prefer_pkgs = get_prefer_pkgs(opts.prefer_pkgs, arch,
os.path.splitext(build_descr)[1],
cpiodata)
cpiodata.add(os.path.basename(build_descr), build_descr_data)
cpiodata.add(os.path.basename(build_descr.encode()), build_descr_data)
build_descr_data = cpiodata.get()
if opts.multibuild_package: