From 9fdfec763dcb9765d7838bcff90487f6411d7b18 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 2 May 2015 17:13:00 +0200 Subject: [PATCH] provide --no-lock-in-top and --no-lock-in-run for packagers --- waflib/Configure.py | 6 +++--- waflib/Options.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/waflib/Configure.py b/waflib/Configure.py index 1433336d..0e3734cb 100644 --- a/waflib/Configure.py +++ b/waflib/Configure.py @@ -192,11 +192,11 @@ class ConfigurationContext(Context.Context): env['files'] = self.files env['environ'] = dict(self.environ) - if not self.env.NO_LOCK_IN_RUN: + if not self.env.NO_LOCK_IN_RUN and not getattr(Options.options, 'no_lock_in_run'): env.store(os.path.join(Context.run_dir, Options.lockfile)) - if not self.env.NO_LOCK_IN_TOP: + if not self.env.NO_LOCK_IN_TOP and not getattr(Options.options, 'no_lock_in_top'): env.store(os.path.join(Context.top_dir, Options.lockfile)) - if not self.env.NO_LOCK_IN_OUT: + if not self.env.NO_LOCK_IN_OUT and not getattr(Options.options, 'no_lock_in_out'): env.store(os.path.join(Context.out_dir, Options.lockfile)) def prepare_env(self, env): diff --git a/waflib/Options.py b/waflib/Options.py index ad6a44ff..f11fe3e3 100644 --- a/waflib/Options.py +++ b/waflib/Options.py @@ -126,6 +126,10 @@ class OptionsContext(Context.Context): gr.add_option('-o', '--out', action='store', default='', help='build dir for the project', dest='out') gr.add_option('-t', '--top', action='store', default='', help='src dir for the project', dest='top') + gr.add_option('--no-lock-in-run', action='store_true', default='', help=optparse.SUPPRESS_HELP, dest='no_lock_in_run') + gr.add_option('--no-lock-in-out', action='store_true', default='', help=optparse.SUPPRESS_HELP, dest='no_lock_in_out') + gr.add_option('--no-lock-in-top', action='store_true', default='', help=optparse.SUPPRESS_HELP, dest='no_lock_in_top') + default_prefix = getattr(Context.g_module, 'default_prefix', os.environ.get('PREFIX')) if not default_prefix: if platform == 'win32':