From c1eea1c68c55e58d7feb79cd7c8b93101f73bf86 Mon Sep 17 00:00:00 2001 From: "y0169.zhang" Date: Wed, 6 Dec 2017 19:15:22 +0800 Subject: [PATCH] Add --outdir-directly option for gbs export, use the directory from gbs build which could get the macros in spec which defined in build.conf Related bug: https://bugs.tizen.org/browse/DEVT-314 Change-Id: Ifd4c8740c2c7cc54b25423169ca8f699233ce0a2 --- gitbuildsys/cmd_export.py | 5 +++-- tools/gbs | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gitbuildsys/cmd_export.py b/gitbuildsys/cmd_export.py index 4f918c9..e240f8f 100644 --- a/gitbuildsys/cmd_export.py +++ b/gitbuildsys/cmd_export.py @@ -329,8 +329,9 @@ def main(args): if not spec.name or not spec.version: raise GbsError('can\'t get correct name or version from spec file.') else: - outdir = "%s/%s-%s-%s" % (outdir, spec.name, spec.upstreamversion, - spec.release) + if not args.outdir_directly: + 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) diff --git a/tools/gbs b/tools/gbs index 27ba9c9..06d3867 100755 --- a/tools/gbs +++ b/tools/gbs @@ -131,6 +131,9 @@ def export_parser(parser): 'colon and diff filename base.') parser.add_argument('--packaging-dir', help='directory containing packaging files') + parser.add_argument('--outdir-directly', action='store_true', + help='Use the directory of --outdir parameter directly' + 'rather than outdir/pkg-version-release') parser.set_defaults(alias="ex") return parser -- 2.7.4