From: y0169.zhang Date: Mon, 29 Jan 2018 05:31:55 +0000 (+0800) Subject: Check the existence of export option 'outdir_directly' X-Git-Tag: submit/devel/20190730.074523~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F168593%2F1;p=tools%2Fgbs.git Check the existence of export option 'outdir_directly' 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 --- diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index e240f8f..70071fb 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -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)