mirror of https://gitlab.com/ita1024/waf.git
disabled the check_exe validation by default and enabled invalid name detection
This commit is contained in:
parent
9b75b843ae
commit
20ae777428
|
@ -327,7 +327,7 @@ class Context(ctx):
|
|||
if 'stderr' not in kw:
|
||||
kw['stderr'] = subprocess.PIPE
|
||||
|
||||
if not kw['shell'] and Utils.check_exe(cmd[0]) is None:
|
||||
if Logs.verbose and not kw['shell'] and not Utils.check_exe(cmd[0]):
|
||||
raise Errors.WafError("Program %s not found!" % cmd[0])
|
||||
|
||||
try:
|
||||
|
@ -391,7 +391,7 @@ class Context(ctx):
|
|||
else:
|
||||
to_ret = STDOUT
|
||||
|
||||
if not kw['shell'] and Utils.check_exe(cmd[0]) is None:
|
||||
if Logs.verbose and not kw['shell'] and not Utils.check_exe(cmd[0]):
|
||||
raise Errors.WafError("Program %s not found!" % cmd[0])
|
||||
|
||||
kw['stdout'] = kw['stderr'] = subprocess.PIPE
|
||||
|
|
|
@ -457,6 +457,8 @@ def check_exe(name):
|
|||
:param name: name or path to program
|
||||
:return: path of the program or None
|
||||
"""
|
||||
if not name:
|
||||
raise ValueError('Cannot execute an empty string!')
|
||||
def is_exe(fpath):
|
||||
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
|
||||
|
||||
|
@ -469,7 +471,6 @@ def check_exe(name):
|
|||
exe_file = os.path.join(path, name)
|
||||
if is_exe(exe_file):
|
||||
return exe_file
|
||||
|
||||
return None
|
||||
|
||||
def def_attrs(cls, **kw):
|
||||
|
|
Loading…
Reference in New Issue