summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--obsapi/core.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/obsapi/core.py b/obsapi/core.py
index cf2ec37..57903e5 100644
--- a/obsapi/core.py
+++ b/obsapi/core.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
#
+import re
from io import BytesIO
from lxml import etree
from collections import namedtuple
@@ -287,14 +288,13 @@ class ObsApi(object):
else:
repos = self.get_project_repos(prj)
+ vendor_re = re.compile(r'.*vendor (.+?)\n')
vendor = None
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:
+ prj_config = self.get_build_config(prj, repo)
+ matches = vendor_re.findall(prj_config)
+ if matches:
+ vendor = matches[-1]
break
return vendor