Add --ccache and --incremental options
authorZhang Qiang <qiang.z.zhang@intel.com>
Tue, 17 Apr 2012 21:58:09 +0000 (05:58 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Fri, 20 Apr 2012 07:17:28 +0000 (15:17 +0800)
gitbuildsys/cmd_localbuild.py
tools/gbs

index 09fa6f4..bfe6858 100644 (file)
@@ -190,14 +190,14 @@ def do(opts, args):
         msger.error('No package repository specified.')
 
     if opts.noinit:
-        cmd += ['--noinit']
+        cmd += ['--no-init']
+    if opts.ccache:
+        cmd += ['--ccache']
     cmd += [specfile]
 
     if hostarch != buildarch and buildarch in change_personality:
         cmd = [ change_personality[buildarch] ] + cmd;
 
-    msger.info(' '.join(cmd))
-
     if buildarch.startswith('arm'):
         try:
             utils.setup_qemu_emulator()
@@ -217,6 +217,12 @@ def do(opts, args):
     mygit = git.Git(workdir)
     mygit.archive("%s-%s/" % (name, version), tarball)
 
+    if opts.incremental:
+        cmd += ['--rsync-src=%s' % os.path.abspath(workdir)]
+        cmd += ['--rsync-dest=/home/abuild/rpmbuild/BUILD/%s-%s' % (name, version)]
+
+    msger.info(' '.join(cmd))
+
     # runner.show() can't support interactive mode, so use subprocess insterad.
     try:
         rc = subprocess.call(cmd)
index 043c42e..aa8d7ce 100755 (executable)
--- a/tools/gbs
+++ b/tools/gbs
@@ -87,6 +87,18 @@ class TizenPkg(cmdln.Cmdln):
                   default=False,
                   dest='noinit',
                   help='Skip initialization of build root and start with build immediately')
+    @cmdln.option('--ccache',
+                  action="store_true",
+                  default=False,
+                  dest='ccache',
+                  help='Use ccache to speed up rebuilds')
+    @cmdln.option('-I', '--incremental',
+                  action="store_true",
+                  default=False,
+                  dest='incremental',
+                  help='Do incremental build, which need support of spec file,'
+                       ' and tar ball unpack stage should be enabled with the '
+                       'condition of RPM macro RSYNCDONE')
     @cmdln.option('--debuginfo',
                   action="store_true",
                   default=False,