1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-29 11:16:14 +01:00

Fix 'buildinfo' command to include obs:cli_debug_packages by default

Add '--no-debug-packages' option that disables the new behavior.
This makes the command consistent with the 'build' command.
This commit is contained in:
Daniel Mach 2024-02-28 08:28:05 +01:00
parent 8b5bdb2a01
commit 94d207fc91

View File

@ -21,6 +21,7 @@ import traceback
from functools import cmp_to_key
from operator import itemgetter
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import List
from urllib.parse import urlsplit
from urllib.error import HTTPError
@ -6626,6 +6627,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='Add this package when computing the buildinfo')
@cmdln.option('-p', '--prefer-pkgs', metavar='DIR', action='append',
help='Prefer packages from this directory when installing the build-root')
@cmdln.option('--nodebugpackages', '--no-debug-packages', action='store_true',
help='Skip installation of additional debug packages for CLI builds (specified in obs:cli_debug_packages in project metadata)')
def do_buildinfo(self, subcmd, opts, *args):
"""
Shows the build info
@ -6705,11 +6708,30 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.multibuild_package:
package = package + ":" + opts.multibuild_package
print(decode_it(get_buildinfo(apiurl,
project, package, repository, arch,
specfile=build_descr_data,
debug=opts.debug_dependencies,
addlist=opts.extra_pkgs)))
extra_pkgs = opts.extra_pkgs.copy() if opts.extra_pkgs else []
if os.path.exists("/usr/lib/build/queryconfig") and not opts.nodebugpackages:
with NamedTemporaryFile(mode="w+b", prefix="obs_buildconfig_") as bc_file:
# print('Getting buildconfig from server and store to %s' % bc_filename)
bc = get_buildconfig(apiurl, project, repository)
bc_file.write(bc)
bc_file.flush()
debug_pkgs = decode_it(return_external("/usr/lib/build/queryconfig", "--dist", bc_file.name, "substitute", "obs:cli_debug_packages"))
if debug_pkgs:
extra_pkgs.extend(debug_pkgs.strip().split(" "))
buildinfo = get_buildinfo(
apiurl,
project,
package,
repository,
arch,
specfile=build_descr_data,
debug=opts.debug_dependencies,
addlist=extra_pkgs,
)
print(decode_it(buildinfo))
def do_buildconfig(self, subcmd, opts, *args):
"""
@ -7078,7 +7100,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('--no-verify', '--noverify', action='store_true',
help='Skip signature verification (via pgp keys) of packages used for build. (Global config in oscrc: no_verify)')
@cmdln.option('--nodebugpackages', '--no-debug-packages', action='store_true',
help='Skip installation of additional debug packages for CLI builds')
help='Skip installation of additional debug packages for CLI builds (specified in obs:cli_debug_packages in project metadata)')
@cmdln.option("--skip-local-service-run", "--noservice", "--no-service", default=False, action="store_true",
help="Skip run of local source services as specified in _service file.")
@cmdln.option('-p', '--prefer-pkgs', metavar='DIR', action='append',