noinit support
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 6 Nov 2012 00:38:15 +0000 (08:38 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Thu, 8 Nov 2012 02:12:41 +0000 (10:12 +0800)
--noinit can't be specified together with --clean or --clean-once

Change-Id: Ib3fd84ae6b53db9478b69c9daf99fe23c5f12c4e

gitbuildsys/cmd_build.py
tools/gbs

index 7454f4f..f901b38 100644 (file)
@@ -225,6 +225,9 @@ def main(args):
     if args.commit and args.include_all:
         raise errors.Usage('--commit can\'t be specified together with '\
                            '--include-all')
+    if args.noinit and (args.clean or args.clean_once):
+        raise errors.Usage('--noinit can\'t be specified together with '\
+                           '--clean or --clean-once')
     workdir = args.gitdir
 
     try:
@@ -280,7 +283,10 @@ def main(args):
         cmd += ['--clean']
 
     # check & prepare repos and build conf
-    cmd += prepare_repos_and_build_conf(args, buildarch, profile)
+    if not args.noinit:
+        cmd += prepare_repos_and_build_conf(args, buildarch, profile)
+    else:
+        cmd += ['--noinit']
 
     cmd += ['--path=%s' % workdir]
 
index fb35e0e..fdcd959 100755 (executable)
--- a/tools/gbs
+++ b/tools/gbs
@@ -210,6 +210,8 @@ def build_parser(parser):
                         'build possible. This requires the configure scripts '
                         'in the spec to be referenced using the %%configure, '
                         '%%reconfigure and %%autogen macros')
+    parser.add_argument('--noinit', action='store_true',
+                        help='start building directly')
 
     parser.set_defaults(alias="lb")
     return parser