Add --outdir-directly option for gbs export, use the directory from
authory0169.zhang <y0169.zhang@samsung.com>
Wed, 6 Dec 2017 11:15:22 +0000 (19:15 +0800)
committery0169.zhang <y0169.zhang@samsung.com>
Wed, 6 Dec 2017 11:27:37 +0000 (19:27 +0800)
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
tools/gbs

index 4f918c9..e240f8f 100644 (file)
@@ -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)
index 27ba9c9..06d3867 100755 (executable)
--- 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