use abspath for export dir
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 31 Jul 2012 04:52:25 +0000 (12:52 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Tue, 31 Jul 2012 08:06:40 +0000 (16:06 +0800)
if running gbs outside of git dir or in sub-dir of git tree, gbs
can't export correctly.

gitbuildsys/cmd_export.py

index da517b0..2f40435 100644 (file)
@@ -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