From a4d3e612a29d6905ca7604d4332f63164a769484 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 8 Feb 2011 16:08:56 -0700 Subject: Handle arches argument for scratch builds (#675285) --- src/fedpkg.py | 6 +++++- src/pyfedpkg/__init__.py | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/fedpkg.py b/src/fedpkg.py index e3e98a5..b4ff5d2 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -286,6 +286,10 @@ def build(args): if hasattr(args, 'srpm') and args.srpm and not args.scratch: log.error('Non-scratch builds cannot be from srpms.') sys.exit(1) + # We may have gotten arches by way of scratch build, so handle them + arches = None + if hasattr(args, 'arches'): + arches = args.arches # Place holder for if we build with an uploaded srpm or not url = None # See if this is a chain or not @@ -327,7 +331,7 @@ def build(args): # Should also try this, again not sure what errors to catch try: task_id = mymodule.build(args.skip_tag, args.scratch, args.background, - url, chain) + url, chain, arches) except pyfedpkg.FedpkgError, e: log.error('Could not initiate build: %s' % e) sys.exit(1) diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index fadcfb1..8696026 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1152,7 +1152,7 @@ class PackageModule: self.hashtype = 'md5' def build(self, skip_tag=False, scratch=False, background=False, - url=None, chain=None): + url=None, chain=None, arches=None): """Initiate a build of the module. Available options are: skip_tag: Skip the tag action after the build @@ -1233,6 +1233,11 @@ class PackageModule: if background: cmd.append('--background') priority = 5 # magic koji number :/ + if arches: + if not scratch: + raise FedpkgError('Cannot override arches for non-scratch builds') + cmd.append('--arch-override=%s' % ','.join(arches)) + opts['arch_override'] = ' '.join(arches) cmd.append(self.target) # see if this build has been done. Does not check builds within -- cgit