mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-01 04:36:13 +01:00
Remove core.setDevelProject() in favor of core.set_devel_project()
This commit is contained in:
parent
537dca3c7f
commit
4a6f069a4c
@ -9032,7 +9032,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
delPerson(apiurl, prj, pac, opts.delete, role)
|
delPerson(apiurl, prj, pac, opts.delete, role)
|
||||||
elif opts.devel_project:
|
elif opts.devel_project:
|
||||||
# XXX: does it really belong to this command?
|
# XXX: does it really belong to this command?
|
||||||
setDevelProject(apiurl, prj, pac, opts.devel_project)
|
set_devel_project(apiurl, prj, pac, opts.devel_project)
|
||||||
else:
|
else:
|
||||||
if pac:
|
if pac:
|
||||||
m = show_package_meta(apiurl, prj, pac)
|
m = show_package_meta(apiurl, prj, pac)
|
||||||
|
30
osc/core.py
30
osc/core.py
@ -7974,36 +7974,6 @@ def setBugowner(apiurl: str, prj: str, pac: str, user=None, group=None):
|
|||||||
data=ET.tostring(root, encoding=ET_ENCODING))
|
data=ET.tostring(root, encoding=ET_ENCODING))
|
||||||
|
|
||||||
|
|
||||||
def setDevelProject(apiurl, prj, pac, dprj, dpkg=None):
|
|
||||||
""" set the <devel project="..."> element to package metadata"""
|
|
||||||
path = (prj, pac)
|
|
||||||
data = meta_exists(metatype='pkg',
|
|
||||||
path_args=path,
|
|
||||||
template_args=None,
|
|
||||||
create_new=False)
|
|
||||||
|
|
||||||
if data and show_project_meta(apiurl, dprj) is not None:
|
|
||||||
root = ET.fromstring(parse_meta_to_string(data))
|
|
||||||
if not root.find('devel') is not None:
|
|
||||||
ET.SubElement(root, 'devel')
|
|
||||||
elem = root.find('devel')
|
|
||||||
if dprj:
|
|
||||||
elem.set('project', dprj)
|
|
||||||
else:
|
|
||||||
if 'project' in elem.keys():
|
|
||||||
del elem.attrib['project']
|
|
||||||
if dpkg:
|
|
||||||
elem.set('package', dpkg)
|
|
||||||
else:
|
|
||||||
if 'package' in elem.keys():
|
|
||||||
del elem.attrib['package']
|
|
||||||
edit_meta(metatype='pkg',
|
|
||||||
path_args=path,
|
|
||||||
data=ET.tostring(root, encoding=ET_ENCODING))
|
|
||||||
else:
|
|
||||||
print("osc: an error occured")
|
|
||||||
|
|
||||||
|
|
||||||
def createPackageDir(pathname, prj_obj=None):
|
def createPackageDir(pathname, prj_obj=None):
|
||||||
"""
|
"""
|
||||||
create and initialize a new package dir in the given project.
|
create and initialize a new package dir in the given project.
|
||||||
|
Loading…
Reference in New Issue
Block a user