From: Zhang Qiang Date: Tue, 17 Apr 2012 21:58:09 +0000 (+0800) Subject: Add --ccache and --incremental options X-Git-Tag: 0.6.2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3054cfe5a0e827667baefaf8cf76dba9268c8053;p=tools%2Fgbs.git Add --ccache and --incremental options --- diff --git a/gitbuildsys/cmd_localbuild.py b/gitbuildsys/cmd_localbuild.py index 09fa6f4..bfe6858 100644 --- a/gitbuildsys/cmd_localbuild.py +++ b/gitbuildsys/cmd_localbuild.py @@ -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) diff --git a/tools/gbs b/tools/gbs index 043c42e..aa8d7ce 100755 --- 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,