Check the existence of export option 'outdir_directly' 93/168593/1
authory0169.zhang <y0169.zhang@samsung.com>
Mon, 29 Jan 2018 05:31:55 +0000 (13:31 +0800)
committerJun Wang <junbill.wang@samsung.com>
Mon, 29 Jan 2018 11:22:41 +0000 (19:22 +0800)
Other package may depends on cmd_export.py, with this
check it may avoid function call error

Change-Id: I8a0e75bd7eff6bb6dbb24c7bf15093ddd89b30ba
Signed-off-by: Jun Wang <junbill.wang@samsung.com>
gitbuildsys/cmd_export.py

index e240f8f..70071fb 100644 (file)
@@ -329,9 +329,14 @@ def main(args):
     if not spec.name or not spec.version:
         raise GbsError('can\'t get correct name or version from spec file.')
     else:
-        if not args.outdir_directly:
+        if 'outdir_directly' in args.__dict__:
+            if not args.outdir_directly:
+                outdir = "%s/%s-%s-%s" % (outdir, spec.name, spec.upstreamversion,
+                                          spec.release)
+        else:
             outdir = "%s/%s-%s-%s" % (outdir, spec.name, spec.upstreamversion,
                                       spec.release)
+
     if os.path.exists(outdir):
         if not os.access(outdir, os.W_OK|os.X_OK):
             raise GbsError('no permission to update outdir: %s' % outdir)