From d950338980f48d50cf5fec953f4c0a296034ac5d Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Tue, 24 Mar 2015 11:13:14 -0400 Subject: [PATCH] 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. --- bin/linja.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/linja.in b/bin/linja.in index 954c6bf82c..e82d6a3214 100755 --- a/bin/linja.in +++ b/bin/linja.in @@ -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