From 383879bf0b4c06b62518f9a8c7849271a265b875 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Tue, 31 Jul 2012 12:52:25 +0800 Subject: [PATCH] use abspath for export dir if running gbs outside of git dir or in sub-dir of git tree, gbs can't export correctly. --- gitbuildsys/cmd_export.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index da517b0..2f40435 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -100,16 +100,18 @@ def do(opts, args): if not os.path.isdir("%s/.git" % workdir): msger.error('Not a git repository (%s), aborting' % workdir) + # Only guess spec filename here, parse later when we have the correct + # spec file at hand + specfile = utils.guess_spec(workdir, opts.spec) + outdir = "%s/packaging" % workdir if opts.outdir: outdir = opts.outdir mkdir_p(outdir) - - # Only guess spec filename here, parse later when we have the correct - # spec file at hand - specfile = utils.guess_spec(workdir, opts.spec) + outdir = os.path.abspath(outdir) tempd = utils.Temp(prefix='gbs_export_', dirn=outdir, directory=True) export_dir = tempd.path + with utils.Workdir(workdir): if opts.commit: commit = opts.commit -- 2.7.4