aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2017-05-23 18:36:06 -0700
committerMisty De Meo2017-05-23 18:36:06 -0700
commit94ed3e358399db37ff88c8a53c6c8cbf7a44e51e (patch)
treed9d6f7758639772e367e8ae4380ace7082283916 /Library
parent129ee966f8a9d1287d3407f81b214ba744b7d4c5 (diff)
downloadbrew-94ed3e358399db37ff88c8a53c6c8cbf7a44e51e.tar.bz2
lock: check tools are executable
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils/lock.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/utils/lock.sh b/Library/Homebrew/utils/lock.sh
index 04d8fd1d5..b3c23c3ef 100644
--- a/Library/Homebrew/utils/lock.sh
+++ b/Library/Homebrew/utils/lock.sh
@@ -42,13 +42,13 @@ _create_lock() {
[[ -x "$ruby" ]] || ruby="$(which ruby 2>/dev/null)"
[[ -x "$python" ]] || python="$(which python 2>/dev/null)"
- if [[ -n "$ruby" && $("$ruby" -e "puts RUBY_VERSION >= '1.8.7' ? 0 : 1") = 0 ]]
+ if [[ -x "$ruby" && $("$ruby" -e "puts RUBY_VERSION >= '1.8.7' ? 0 : 1") = 0 ]]
then
"$ruby" -e "File.new($lock_fd).flock(File::LOCK_EX | File::LOCK_NB) || exit(1)"
- elif [[ -n "$(which flock)" ]]
+ elif [[ -x "$(which flock)" ]]
then
flock -n "$lock_fd"
- elif [[ -n "$python" ]]
+ elif [[ -x "$python" ]]
then
"$python" -c "import fcntl; fcntl.flock($lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)"
else