cmd_export: Used absolute path to spec file to avoid wrong
authorEd Bartosh <eduard.bartosh@intel.com>
Thu, 26 Jul 2012 08:56:39 +0000 (11:56 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Fri, 27 Jul 2012 09:24:49 +0000 (12:24 +0300)
determination of spec path. Fixes #185

When spec file is passed as a parameter --spec and path is relative it
caused an error in path determination and gbs export was failing with
error: RPM error while parsing spec: can't parse specfile. This change
fixes the issue.

Change-Id: I1e388e88453423f6c529b0012d60d5251a64838c

gitbuildsys/cmd_export.py

index d14816b..8a33f4d 100644 (file)
@@ -106,7 +106,7 @@ def do(opts, args):
 
     # Only guess spec filename here, parse later when we have the correct
     # spec file at hand
-    specfile = utils.guess_spec(workdir, opts.spec)
+    specfile = utils.guess_spec(workdir, os.path.abspath(opts.spec))
     tempd = utils.Temp(prefix='gbs_export_', dirn=outdir, directory=True)
     export_dir = tempd.path
     with utils.Workdir(workdir):