diff options
Diffstat (limited to 'obsapi')
| -rw-r--r-- | obsapi/core.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/obsapi/core.py b/obsapi/core.py index 9445f3f..c9b2b40 100644 --- a/obsapi/core.py +++ b/obsapi/core.py @@ -268,10 +268,19 @@ class ObsApi(object): return self.get_xml(api) def get_vendor(self, prj, repo=None): - repo = repo or self.get_project_repos(prj)[0] + ''' Attempt to get the value of the %vendor macro if exists + Search build configs from all repos. Take first occurance. + ''' + project_repos = self.get_project_repos(prj) + repos = [repo] or project_repos vendor = None - for line in self.get_build_config(prj, repo).splitlines(): - if line.strip().startswith('%vendor '): - vendor = line.split(' ', 1)[1] + for repo in repos: + for line in self.get_build_config(prj, repo).splitlines(): + if line.strip().startswith('%vendor '): + vendor = line.split(' ', 1)[1] + + # We take the first occurance + if vendor is not None: + break return vendor |
