summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2011-02-08 16:08:56 -0700
committerJesse Keating <jkeating@redhat.com>2011-02-08 16:08:56 -0700
commita4d3e612a29d6905ca7604d4332f63164a769484 (patch)
treea1edfd482e192c2fc84da4ad20ecad62c9ea744c
parent99aacb5de55172baebd08bbce5ce4f1dbbc6ff1a (diff)
downloadfedora-packager-a4d3e612a29d6905ca7604d4332f63164a769484.zip
fedora-packager-a4d3e612a29d6905ca7604d4332f63164a769484.tar.gz
fedora-packager-a4d3e612a29d6905ca7604d4332f63164a769484.tar.xz
Handle arches argument for scratch builds (#675285)
-rwxr-xr-xsrc/fedpkg.py6
-rw-r--r--src/pyfedpkg/__init__.py7
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