From 3054cfe5a0e827667baefaf8cf76dba9268c8053 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Wed, 18 Apr 2012 05:58:09 +0800 Subject: [PATCH] Add --ccache and --incremental options --- gitbuildsys/cmd_localbuild.py | 12 +++++++++--- tools/gbs | 12 ++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) 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, -- 2.7.4