diff options
Diffstat (limited to 'obsapi')
| -rw-r--r-- | obsapi/core.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/obsapi/core.py b/obsapi/core.py index f1a27ed..e46e57f 100644 --- a/obsapi/core.py +++ b/obsapi/core.py @@ -351,6 +351,26 @@ class ObsApi(object): api = '/build/{}/{}/_buildconfig'.format(prj, repo) return self.get_xml(api) + def get_build_info(self, prj, pkg, repo, arch): + api = '/build/{}/{}/{}/{}/_buildinfo'.format(prj, repo, arch, pkg) + return self.get_xml(api) + + def get_nothing_provides(self, prj, pkg, repo, arch): + tree = etree.fromstring(self.get_build_info(prj, pkg, repo, arch)) + errors = (tree.xpath('error') or [EMPTY])[0] + nothing_provides = [] + + if errors is None or 'unresolvable' not in errors: + return nothing_provides + + for unresolvable in [u.strip() for + u in errors.split('unresolvable:')[1].split(',')]: + if unresolvable.startswith('nothing provides'): + nothing_provides.append(unresolvable.split( + 'nothing provides ')[1]) + + return nothing_provides + def get_vendor(self, prj, repo=None): ''' Attempt to get the value of the %vendor macro if exists Search build configs from all repos. Take first occurance. |
