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 d14816bec4821d54c0ac3e429bed5c6fb5171268..8a33f4d762061ea67854d1f4af1f3d1b7a025c31 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):