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

Remove core.setDevelProject() in favor of core.set_devel_project()

This commit is contained in:
Daniel Mach 2024-02-14 08:44:19 +01:00
parent 537dca3c7f
commit 4a6f069a4c
2 changed files with 1 additions and 31 deletions

View File

@ -9032,7 +9032,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
delPerson(apiurl, prj, pac, opts.delete, role)
elif opts.devel_project:
# 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:
if pac:
m = show_package_meta(apiurl, prj, pac)

View File

@ -7974,36 +7974,6 @@ def setBugowner(apiurl: str, prj: str, pac: str, user=None, group=None):
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):
"""
create and initialize a new package dir in the given project.