when writing out the mock configs set the target arch instead of canonical arch used for %_host_cpu and %_host macros and _target_arch variable in the written out configs

This commit is contained in:
Dennis Gilmore 2011-11-16 18:02:58 -06:00 committed by Mike McLean
parent dd48297c04
commit 310d7a0246
2 changed files with 5 additions and 3 deletions

View file

@ -180,6 +180,7 @@ class BuildRoot(object):
elif repo_state != 'READY':
raise koji.BuildrootError, "Requested repo (%i) is %s" % (repo_id, repo_state)
self.br_arch = koji.canonArch(arch)
self.target_arch = arch
self.logger.debug("New buildroot: %(tag_name)s/%(br_arch)s/%(repoid)s" % vars(self))
id = self.session.host.newBuildRoot(self.repoid, self.br_arch, task_id=task_id)
if id is None:
@ -212,6 +213,7 @@ class BuildRoot(object):
opts['maven_opts'] = self.maven_opts
opts['maven_envs'] = self.maven_envs
opts['bind_opts'] = self.bind_opts
opts['target_arch'] = self.target_arch
output = koji.genMockConfig(self.name, self.br_arch, managed=True, **opts)
#write config

View file

@ -1240,7 +1240,7 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts)
config_opts = {
'root' : name,
'basedir' : mockdir,
'target_arch' : arch,
'target_arch' : opts.get('target_arch', arch),
'chroothome': '/builddir',
# Use the group data rather than a generated rpm
'chroot_setup_cmd': 'groupinstall %s' % opts.get('install_group', 'build'),
@ -1297,8 +1297,8 @@ baseurl=%(url)s
macros = {
'%_topdir' : '%s/build' % config_opts['chroothome'],
'%_rpmfilename' : '%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm',
'%_host_cpu' : arch,
'%_host': '%s-%s' % (arch, opts.get('mockhost', 'koji-linux-gnu')),
'%_host_cpu' : opts.get('target_arch', arch),
'%_host': '%s-%s' % (opts.get('target_arch', arch), opts.get('mockhost', 'koji-linux-gnu')),
'%vendor' : opts.get('vendor', 'Koji'),
'%packager' : opts.get('packager', 'Koji'),
'%distribution': opts.get('distribution', 'Unknown')