diff options
author | Jesse Keating <jkeating@redhat.com> | 2011-03-03 15:49:29 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2011-03-03 15:49:29 -0700 |
commit | 48e3694c6d2961cbd4e677de5adbfc2cf9ab4928 (patch) | |
tree | 2be6978a480e3e299d9fb8e4a9b251918afb0b5d | |
parent | 9530a23fa389fd3b1dd9bd065fb340e44687afac (diff) | |
download | fedora-packager-48e3694c6d2961cbd4e677de5adbfc2cf9ab4928.tar.gz fedora-packager-48e3694c6d2961cbd4e677de5adbfc2cf9ab4928.tar.xz fedora-packager-48e3694c6d2961cbd4e677de5adbfc2cf9ab4928.zip |
Add code to handle chain builds with sets better.
When doing chain builds, the last package can be treated one of two
ways.
1) It can be added to the end of the list to be built serially, it would
be the last build.
2) It can be added to the last set in the chain to be built in parallel
with the last set.
Which way depends on if sets are used or not. This code should handle
both correctly.
-rw-r--r-- | src/pyfedpkg/__init__.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 5b5c99e..c130864 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -1213,7 +1213,7 @@ class PackageModule: self.hashtype = 'md5' def build(self, skip_tag=False, scratch=False, background=False, - url=None, chain=None, arches=None): + url=None, chain=None, arches=None, sets=False): """Initiate a build of the module. Available options are: skip_tag: Skip the tag action after the build @@ -1228,6 +1228,8 @@ class PackageModule: arches: A set of arches to limit the scratch build for + sets: A boolean to let us know whether or not the chain has sets + This function submits the task to koji and returns the taskID It is up to the client to wait or watch the task. @@ -1316,7 +1318,14 @@ class PackageModule: # Handle the chain build version if chain: log.debug('Adding %s to the chain' % url) - chain.append([url]) + # If we're dealing with build sets the behaviour of the last + # package changes, and we add it to the last (potentially empty) + # set. Otherwise the last package just gets added to the end of + # the chain. + if sets: + chain[-1].append(url) + else: + chain.append([url]) # This next list comp is ugly, but it's how we properly get a : # put in between each build set cmd.extend(' : '.join([' '.join(sets) for sets in chain]).split()) |