mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-24 22:06:14 +01:00
Add branch --disable-build option
This commit is contained in:
parent
2ec573ca79
commit
4c5d0cf18a
@ -3539,6 +3539,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
help='specify the used block strategy for new repositories')
|
||||
@cmdln.option('--add-repositories-rebuild', metavar='add_repositories_rebuild',
|
||||
help='specify the used rebuild strategy for new repositories')
|
||||
@cmdln.option('--disable-build', action='store_true',
|
||||
help='disable building of the branched package')
|
||||
def do_branch(self, subcmd, opts, *args):
|
||||
"""
|
||||
Branch a package
|
||||
@ -3608,7 +3610,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
add_repositories_rebuild=opts.add_repositories_rebuild,
|
||||
extend_package_names=opts.extend_package_names,
|
||||
missingok=opts.new_package,
|
||||
maintenance=opts.maintenance)
|
||||
maintenance=opts.maintenance,
|
||||
disable_build=opts.disable_build)
|
||||
except oscerr.NotMissing as e:
|
||||
print('NOTE: Package target exists already via project links, link will point to given project.')
|
||||
print(' A submission will initialize a new instance.')
|
||||
@ -3625,7 +3628,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
extend_package_names=opts.extend_package_names,
|
||||
missingok=False,
|
||||
maintenance=opts.maintenance,
|
||||
newinstance=opts.new_package)
|
||||
newinstance=opts.new_package,
|
||||
disable_build=opts.disable_build)
|
||||
|
||||
if exists:
|
||||
print('Using existing branch project: %s' % targetprj, file=sys.stderr)
|
||||
|
16
osc/core.py
16
osc/core.py
@ -5576,7 +5576,7 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
|
||||
return r
|
||||
|
||||
|
||||
def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None, linkrev=None, target_project=None, target_package=None, return_existing=False, msg='', force=False, noaccess=False, add_repositories=False, add_repositories_block=None, add_repositories_rebuild=None, extend_package_names=False, missingok=False, maintenance=False, newinstance=False):
|
||||
def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None, linkrev=None, target_project=None, target_package=None, return_existing=False, msg='', force=False, noaccess=False, add_repositories=False, add_repositories_block=None, add_repositories_rebuild=None, extend_package_names=False, missingok=False, maintenance=False, newinstance=False, disable_build=False):
|
||||
"""
|
||||
Branch a package (via API call)
|
||||
"""
|
||||
@ -5636,6 +5636,20 @@ def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None,
|
||||
data = {}
|
||||
for i in root.findall('data'):
|
||||
data[i.get('name')] = i.text
|
||||
|
||||
if disable_build:
|
||||
target_meta = show_package_meta(apiurl, data["targetproject"], data["targetpackage"])
|
||||
root = ET.fromstring(b''.join(target_meta))
|
||||
|
||||
elm = root.find('build')
|
||||
if not elm:
|
||||
elm = ET.SubElement(root, 'build')
|
||||
elm.clear()
|
||||
ET.SubElement(elm, 'disable')
|
||||
|
||||
target_meta = ET.tostring(root, encoding=ET_ENCODING)
|
||||
edit_meta('pkg', path_args=(data["targetproject"], data["targetpackage"]), data=target_meta)
|
||||
|
||||
return (False, data.get('targetproject', None), data.get('targetpackage', None),
|
||||
data.get('sourceproject', None), data.get('sourcepackage', None))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user