diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-07-14 22:33:48 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-07-14 22:33:48 -0700 |
commit | f58e03c4d3afded99fbc27a0c6d5350049515dd3 (patch) | |
tree | 4c165b5c21d93eb09bd69e6f043f56d82e7b516f /src/pyfedpkg | |
parent | 10dece68c48f1e7153ca7acdd0d1c2add515e381 (diff) | |
download | fedora-packager-f58e03c4d3afded99fbc27a0c6d5350049515dd3.tar.gz fedora-packager-f58e03c4d3afded99fbc27a0c6d5350049515dd3.tar.xz fedora-packager-f58e03c4d3afded99fbc27a0c6d5350049515dd3.zip |
Print out the user eqiv koji command
Even though we don't use koji directly, it's helpful to users if we show
them the command they would have to use to duplicate what we are doing.
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r-- | src/pyfedpkg/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 5828d93..53b7e3e 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -679,6 +679,8 @@ class PackageModule: """ + # build up the command that a user would issue + cmd = ['koji'] # Make sure we have a valid session. if not self.kojisession: raise FedpkgError('No koji session found.') @@ -709,37 +711,48 @@ class PackageModule: raise FedpkgError('Destination tag %s is locked' % dest_tag['name']) # If we're chain building, make sure inheritance works if chain: + cmd.append('chain-build') ancestors = self.kojisession.getFullInheritance(build_target['build_tag']) if dest_tag['id'] not in [build_target['build_tag']] + [ancestor['parent_id'] for ancestor in ancestors]: raise FedpkgError('Packages in destination tag ' \ '%(dest_tag_name)s are not inherited by' \ 'build tag %(build_tag_name)s' % build_target) + else: + cmd.append('build') # define our dictionary for options opts = {} # Set a placeholder for the build priority priority = None if skip_tag: opts['skip_tag'] = True + cmd.append('--skip-tag') if scratch: opts['scratch'] = True + cmd.append('--scratch') if background: + cmd.append('--background') priority = 5 # magic koji number :/ + cmd.append(self.target) # Now submit the task and get the task_id to return # Handle the chain build version if chain: log.debug('Adding %s to the chain' % url) chain[-1].append(url) + cmd.append(url) log.debug('Building chain %s for %s with options %s and a ' \ 'priority of %s' % (chain, self.target, opts, priority)) + log.debug(subprocess.list2cmdline(cmd)) task_id = self.kojisession.chainBuild(chain, self.target, opts, priority=priority) # Now handle the normal build else: + cmd.append(url) log.debug('Building %s for %s with options %s and a priority of %s' % (url, self.target, opts, priority)) + log.debug(subprocess.list2cmdline(cmd)) task_id = self.kojisession.build(url, self.target, opts, priority=priority) log.info('Created task: %s' % task_id) |