mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-05 19:00:56 +01:00
Migrate core.show_package_disabled_repos() to obs_api.Package
This commit is contained in:
parent
f5b782edc8
commit
f62b11ea86
21
osc/core.py
21
osc/core.py
@ -3910,20 +3910,15 @@ def set_devel_project(apiurl, prj, pac, devprj=None, devpac=None, print_to="debu
|
||||
|
||||
|
||||
def show_package_disabled_repos(apiurl: str, prj: str, pac: str):
|
||||
m = show_package_meta(apiurl, prj, pac)
|
||||
from . import obs_api
|
||||
|
||||
# FIXME: don't work if all repos of a project are disabled and only some are enabled since <disable/> is empty
|
||||
try:
|
||||
root = ET.fromstring(''.join(m))
|
||||
elm = root.find('build')
|
||||
r = []
|
||||
for node in elm.findall('disable'):
|
||||
repo = node.get('repository')
|
||||
arch = node.get('arch')
|
||||
dis_r = {'repo': repo, 'arch': arch}
|
||||
r.append(dis_r)
|
||||
return r
|
||||
except:
|
||||
return None
|
||||
package_obj = obs_api.Package.from_api(apiurl, prj, pac)
|
||||
result = []
|
||||
for i in package_obj.build_list or []:
|
||||
if i.flag == "disable":
|
||||
result.append({"repo": i.repository, "arch": i.arch})
|
||||
return result
|
||||
|
||||
|
||||
def show_pattern_metalist(apiurl: str, prj: str):
|
||||
|
Loading…
x
Reference in New Issue
Block a user