#192 Move all the arbitrary list(s) of arches to one place (utility library?)
Closed: Fixed Opened by jskladan.

At the moment, we have multiple lists of 'OK' archs scattered through the whole libtaskotron library (e.g. runner, bodhi_directive). Inspect the code, and unify our arch handling. In the ideal situation, there should be no arbitrary lists of arches, but the code should reference some (global?) variables, most probably put to an utility library.

As a first step, make a list of 'arch checks' in the code, and post it into this ticket's comment.
Next up, decide how to group the respective arch checks, and work out (probably several) logically bound groups of arches, so the arbitrary lists can be replaced with variables.
Finally, replace the arbitrary lists, and document our available 'arch groups' and the meaning of each group.


This ticket had assigned some Differential requests:
D220

List of 'arch checks'
- in runner:

if args['arch'] is None:
        args['arch'] = ['noarch']
  • in koji_utils:
if 'i386' in arches and 'i686' not in arches:
     arches.append('i686')
...
if src and ('src' not in arches):
    arches.append('src')
  • in rpm_utils:
if arch in ('i486', 'i586', 'i686'):
    arch = 'i386'
  • in bodhi_directive:
if 'all' in input_data['arch']:
    arches = ['i386', 'x86_64', 'noarch', 'armhfp']
else:
    arches = input_data['arch']
if 'noarch' not in arches and arches != ['src']:
    arches.append('noarch')
  • in koji_directive:
if self.arches and ('noarch' not in self.arches):
    self.arches.append('noarch')
  • in yumrepoinfo_directive:
processed_arches = [arch for arch in arches if arch not in ['noarch', 'all', 'src']]

Proposed arch utils

from bunch import Bunch
# supported architectures
arches = Bunch()
arches.i386 = 'i386'
arches.i586 = 'i586'
arches.i686 = 'i686'
arches.x86_64 = 'x86_64'
arches.armhfp = 'armhfp'
arches.noarch = 'noarch'
arches.src = 'src'
arches.supported = [arch for arch in arches]
arches.all = [arches.i386, arches.x86_64, arches.armhfp, arches.noarch]
arches.real = [arches.i386, arches.x86_64, arches.armhfp] # i586, i686 ?
arches.x86 = [arches.i386, arches.i586, arches.i686]

Closing (D220).

Metadata Update from @jskladan:
- Issue tagged with: easyfix

Metadata