| |
@@ -1988,26 +1988,30 @@
|
| |
buildrequires = self.args.buildrequires or []
|
| |
branch_search = None
|
| |
try:
|
| |
- # The regex to parse the base module stream override from the dist-git branch name.
|
| |
+ # The regexes to parse the base module stream override from the dist-git branch name.
|
| |
# For example, if you had a branch called `10-fedora-29.0.1` and you wanted to
|
| |
# parse `f29.0.1` from that as the stream to use for the base module, you could
|
| |
# have a regex of `(f)(?:edora)(?:\-)(\d+\.\d+\.\d+)$`. Then after combining
|
| |
# the capture groups, you'd get the desired result of `f29.0.1`.
|
| |
- branch_bm_regex = self.config.get(
|
| |
- self.config_section, 'base_module_stream_regex_from_branch')
|
| |
+ branch_bm_regexes = self.config.get(
|
| |
+ self.config_section, 'base_module_stream_regex_from_branch').strip().split('\n')
|
| |
# The base module (e.g. platform) to apply the buildrequire override to if the parsing
|
| |
# of the branch name is successfull
|
| |
bm = self.config.get(self.config_section, 'base_module')
|
| |
except configparser.NoOptionError:
|
| |
pass
|
| |
else:
|
| |
- branch_search = re.search(branch_bm_regex, branch)
|
| |
+ # Check if any of the regexes match, and break after the first match
|
| |
+ for regex in branch_bm_regexes:
|
| |
+ branch_search = re.search(regex, branch)
|
| |
+ if branch_search:
|
| |
+ break
|
| |
|
| |
if branch_search:
|
| |
- # Concatenate all the groups together to get the desired stream.
|
| |
+ # Concatenate all the groups that are not None together to get the desired stream.
|
| |
# This approach is taken in case there are sections to ignore.
|
| |
# For instance, if we need to parse `f27.0.0` from `fedora-27.0.0`.
|
| |
- bm_stream = ''.join(branch_search.groups())
|
| |
+ bm_stream = ''.join(group for group in branch_search.groups() if group)
|
| |
# Don't override the base module buildrequire if the user
|
| |
# manually already overrode it with the `--buildrequire` argument
|
| |
if not any(br[0] == bm for br in buildrequires):
|
| |
This is to support the use-case described in FACTORY-3896