mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 09:57:15 +01:00
Allow passing args through to 'waf configure' in 'waf distcheck'.
This adds a new option, --distcheck-args, which can be set to specify the args that will be passed to 'waf configure' when running 'waf distcheck'. If the option is not set, all arguments starting with '-' passed to 'waf distcheck' are passed instead.
This commit is contained in:
parent
779a93f07b
commit
3368341313
@ -93,6 +93,8 @@ class opt_parser(optparse.OptionParser):
|
||||
gr.add_option('--destdir', help='installation root [default: %r]' % default_destdir, default=default_destdir, dest='destdir')
|
||||
gr.add_option('-f', '--force', dest='force', default=False, action='store_true', help='force file installation')
|
||||
|
||||
gr.add_option('--distcheck-args', help='arguments to pass to distcheck', default=None, action='store')
|
||||
|
||||
def get_usage(self):
|
||||
"""
|
||||
Return the message to print on ``waf --help``
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
"Module called for configuring, compiling and installing targets"
|
||||
|
||||
import os, shutil, traceback, errno, sys, stat
|
||||
import os, shlex, shutil, traceback, errno, sys, stat
|
||||
from waflib import Utils, Configure, Logs, Options, ConfigSet, Context, Errors, Build, Node
|
||||
|
||||
build_dir_override = None
|
||||
@ -515,8 +515,15 @@ class DistCheck(Dist):
|
||||
if t:
|
||||
t.close()
|
||||
|
||||
cfg = []
|
||||
|
||||
if Options.options.distcheck_args:
|
||||
cfg = shlex.split(Options.options.distcheck_args)
|
||||
else:
|
||||
cfg = [x for x in sys.argv if x.startswith('-')]
|
||||
|
||||
instdir = tempfile.mkdtemp('.inst', self.get_base_name())
|
||||
ret = Utils.subprocess.Popen([sys.argv[0], 'configure', 'install', 'uninstall', '--destdir=' + instdir], cwd=self.get_base_name()).wait()
|
||||
ret = Utils.subprocess.Popen([sys.argv[0], 'configure', 'install', 'uninstall', '--destdir=' + instdir] + cfg, cwd=self.get_base_name()).wait()
|
||||
if ret:
|
||||
raise Errors.WafError('distcheck failed with code %i' % ret)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user