add comment and docstring to choose_taskarch()

This commit is contained in:
Mike McLean 2016-10-20 10:14:25 -04:00
parent 2062515663
commit 63a358b260

View file

@ -959,11 +959,15 @@ class BuildTask(BaseTaskHandler):
return archdict.keys()
def choose_taskarch(self, arch, srpm, build_tag, extra=None):
"""Adjust the arch for buildArch subtask as needed"""
if koji.util.multi_fnmatch(arch, self.options.literal_task_arches):
return arch
if arch != 'noarch':
return koji.canonArch(arch)
# For noarch, attempt to honor ExcludeArch/ExclusiveArch
# see https://pagure.io/koji/issue/19
h = self.readSRPMHeader(srpm)
buildarchs = h[rpm.RPMTAG_BUILDARCHS]
exclusivearch = h[rpm.RPMTAG_EXCLUSIVEARCH]