diff --git a/osc/build.py b/osc/build.py index 1b654bba..1ae3d5b6 100644 --- a/osc/build.py +++ b/osc/build.py @@ -351,7 +351,7 @@ def main(opts, argv): bi_file.flush() bi = Buildinfo(bi_file.name, apiurl) - if bi.debuginfo: + if bi.debuginfo and not (opts.debuginfo or opts.disable_debuginfo): buildargs.append('--debug') buildargs = ' '.join(set(buildargs)) diff --git a/osc/commandline.py b/osc/commandline.py index 59ea3e6d..ac02c7d3 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1893,12 +1893,14 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='Run build as root. The default is to build as ' 'unprivileged user. Note that a line "# norootforbuild" ' 'in the spec file will invalidate this option.') - @cmdln.option('', '--local-package', action='store_true', + @cmdln.option('--local-package', action='store_true', help='build a package which does not exist on the server') - @cmdln.option('', '--alternative-project', metavar='PROJECT', + @cmdln.option('--alternative-project', metavar='PROJECT', help='specify the build target project') @cmdln.option('-d', '--debuginfo', action='store_true', help='also build debuginfo sub-packages') + @cmdln.option('--disable-debuginfo', action='store_true', + help='disable build of debuginfo packages') @cmdln.option('-b', '--baselibs', action='store_true', help='Create -32bit/-64bit/-x86 rpms for other architectures') def do_build(self, subcmd, opts, *args): @@ -1950,6 +1952,9 @@ Please submit there instead, or use --nodevelproject to force direct submission. sys.stderr.write('See http://download.opensuse.org/repositories/openSUSE:/Tools/\n') return 1 + if opts.debuginfo and opts.disable_debuginfo: + raise oscerr.WrongOptions('osc: --debuginfo and --disable-debuginfo are mutual exclusive') + if len(args) > 3: raise oscerr.WrongArgs('Too many arguments')