From: Markus Lehtonen Date: Tue, 11 Sep 2012 08:59:23 +0000 (+0300) Subject: Use GBS temp dir for GBP, too X-Git-Tag: 0.10~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51b9bd03b12cedaf4e880d7ba5888365c1303e5d;p=tools%2Fgbs.git Use GBS temp dir for GBP, too Fixes #332. Signed-off-by: Markus Lehtonen --- diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index 8e7855f..1298c6e 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -54,7 +54,7 @@ def is_native_pkg(repo, opts): upstream_branch = configmgr.get('upstream_branch', 'general') return not repo.has_branch(upstream_branch) -def create_gbp_export_args(repo, commit, export_dir, spec, opts, +def create_gbp_export_args(repo, commit, export_dir, tmp_dir, spec, opts, force_native=False): """ Construct the cmdline argument list for git-buildpackage export @@ -74,6 +74,7 @@ def create_gbp_export_args(repo, commit, export_dir, spec, opts, "--git-ignore-new", "--git-builder=osc", "--git-upstream-branch=upstream", "--git-export-dir=%s" % export_dir, + "--git-tmp-dir=%s" % tmp_dir, "--git-packaging-dir=packaging", "--git-spec-file=%s" % spec, "--git-export=%s" % commit, @@ -95,7 +96,11 @@ def export_sources(repo, commit, export_dir, spec, opts): """ Export packaging files using git-buildpackage """ - gbp_args = create_gbp_export_args(repo, commit, export_dir, spec, opts) + tmp = utils.Temp(prefix='gbp_', dirn=configmgr.get('tmpdir', 'general'), + directory=True) + + gbp_args = create_gbp_export_args(repo, commit, export_dir, tmp.path, + spec, opts) try: ret = gbp_build(gbp_args) if ret and not is_native_pkg(repo, opts): @@ -111,7 +116,8 @@ def export_sources(repo, commit, export_dir, spec, opts): msger.info("Falling back to the old method of generating one "\ "monolithic source archive") gbp_args = create_gbp_export_args(repo, commit, export_dir, - spec, opts, force_native=True) + tmp.path, spec, opts, + force_native=True) ret = gbp_build(gbp_args) if ret: msger.error("Failed to export packaging files from git tree")