kojid literal_task_arches option
This commit is contained in:
parent
4f131ef32a
commit
4e3e65c11f
2 changed files with 19 additions and 1 deletions
|
|
@ -857,11 +857,15 @@ class BuildTask(BaseTaskHandler):
|
|||
subtasks = {}
|
||||
keep_srpm = True
|
||||
for arch in archlist:
|
||||
if koji.util.multi_fnmatch(arch, self.options.literal_task_arches):
|
||||
taskarch = arch
|
||||
else:
|
||||
taskarch = koji.canonArch(arch)
|
||||
subtasks[arch] = self.session.host.subtask(method='buildArch',
|
||||
arglist=[srpm, build_tag, arch, keep_srpm, {'repo_id': repo_id}],
|
||||
label=arch,
|
||||
parent=self.id,
|
||||
arch=koji.canonArch(arch))
|
||||
arch=taskarch)
|
||||
keep_srpm = False
|
||||
|
||||
self.logger.debug("Got subtasks: %r" % (subtasks))
|
||||
|
|
@ -2878,6 +2882,7 @@ def get_options():
|
|||
quit('invalid section found in config file: %s' % x)
|
||||
defaults = {'sleeptime': 15,
|
||||
'maxjobs': 10,
|
||||
'literal_task_arches': '',
|
||||
'minspace': 8192,
|
||||
'admin_emails': None,
|
||||
'topdir': '/mnt/koji',
|
||||
|
|
|
|||
13
koji/util.py
13
koji/util.py
|
|
@ -15,6 +15,7 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
import calendar
|
||||
from fnmatch import fnmatch
|
||||
import re
|
||||
import time
|
||||
import koji
|
||||
|
|
@ -107,6 +108,18 @@ def printList(l):
|
|||
ret += l[-1]
|
||||
return ret
|
||||
|
||||
def multi_fnmatch(s, patterns):
|
||||
"""Returns true if s matches any pattern in the list
|
||||
|
||||
If patterns is a string, it will be split() first
|
||||
"""
|
||||
if isinstance(patterns, basestring):
|
||||
patterns = patterns.split()
|
||||
for pat in patterns:
|
||||
if fnmatch(s, pat):
|
||||
return True
|
||||
return False
|
||||
|
||||
def dslice(dict, keys, strict=True):
|
||||
"""Returns a new dictionary containing only the specified keys"""
|
||||
ret = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue