fix(bin/linja): which does not look for 'sbin'
Ubuntu-12/14 has two packages which provide a binary file `ninja`: 1. ninja : http://forkbomb.org/ninja/ 2. ninja-build : http://martine.github.io/ninja/ We had a case where a user has ninja installed instead of ninja-build, then linja confuses that it has ninja-build and tries to use it. This commit excludes a directory whose name includes "sbin" in finding a system program. As a result, `which` will not find ninja[1] which resides at /usr/sbin.
This commit is contained in:
parent
30e3049c56
commit
d950338980
1 changed files with 2 additions and 0 deletions
|
@ -334,6 +334,8 @@ def which(program):
|
|||
else:
|
||||
for path in os.environ["PATH"].split(os.pathsep):
|
||||
path = path.strip('"')
|
||||
if "sbin" in path:
|
||||
continue
|
||||
exe_file = os.path.join(path, program)
|
||||
if is_exe(exe_file):
|
||||
return exe_file
|
||||
|
|
Loading…
Reference in a new issue