ostbuild: Only check out source if we need to

When using --skip-built, we shouldn't do a checkout if we're not going
to build.
This commit is contained in:
Colin Walters 2012-03-08 09:02:46 -05:00
parent c3c751ffb5
commit ee49c8098c
1 changed files with 4 additions and 4 deletions

View File

@ -100,10 +100,6 @@ class OstbuildBuild(builtins.Builtin):
buildname = buildutil.manifest_buildname(self.manifest, meta)
buildroot_name = buildutil.manifest_buildroot_name(self.manifest, meta)
checkoutdir = os.path.join(self.workdir, 'src')
component_src = os.path.join(checkoutdir, name)
run_sync(['ostbuild', 'checkout', '--overwrite', '--manifest=' + self.manifest_path, name], cwd=checkoutdir)
current_vcs_version = meta['revision']
previous_build_version = run_sync_get_output(['ostree', '--repo=' + self.repo,
@ -132,6 +128,10 @@ class OstbuildBuild(builtins.Builtin):
else:
log("No previous build for '%s' found" % (buildname, ))
checkoutdir = os.path.join(self.workdir, 'src')
component_src = os.path.join(checkoutdir, name)
run_sync(['ostbuild', 'checkout', '--overwrite', '--manifest=' + self.manifest_path, name], cwd=checkoutdir)
artifact_meta = dict(meta)
metadata_path = os.path.join(component_src, '_ostbuild-meta.json')