11 Commits

Author SHA1 Message Date
Buck Evan
0a2e649f00 type -P is more portable than which
Migrated from https://github.com/Linuxbrew/brew/pull/621
2018-03-18 16:51:22 -07:00
Michka Popoff
b93ed4124c lock.sh: suppress error output when looking for flock
Fixes (on centos6):
which: no flock in (/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
2017-10-27 15:54:24 +02:00
Misty De Meo
67dc3323ed
lock: simplify ruby conditional 2017-05-24 09:12:21 -07:00
Misty De Meo
94ed3e3583
lock: check tools are executable 2017-05-23 18:36:06 -07:00
Misty De Meo
129ee966f8 Optionally use Python's flock instead of Ruby's
Ruby first gained flock in 1.8.7, which is a problem since we're using
this lock utility in `vendor-install` in order to install a newer Ruby.

Fortunately, Python 2.3(!) has flock support.
2017-05-23 17:50:22 -07:00
Mike McQuaid
9edf8eb1fe Check the lock directory is writable.
And, if it isn't, print more helpful debugging messages.

Fixes #1456.
2016-11-11 22:52:21 +00:00
Mike McQuaid
e3609b6fd4 Move LinkedKegs/PinnedKegs/Locks from Library.
These don't make sense to be tied to the `HOMEBREW_REPOSITORY` but
instead should live in the `HOMEBREW_PREFIX` as they all relate to its
state.
2016-09-16 13:51:56 +01:00
Martin Afanasjew
1c27a75ca4 utils/lock.sh: remove redundant 'local' 2016-06-29 22:38:42 +02:00
Xu Cheng
8d64b6a02d introduce global lock directory (#337)
Since #292, HOMEBREW_CACHE was moved to a per-user directory. This makes
it unsuitable to store global lock files on multiple users environment.

Therefore, introducing a global lock directory `/Library/Lock.d` to
store lock files from formula lockers as well as `brew update`.
2016-06-08 17:29:03 +08:00
Mike McQuaid
8ecfab8a59 utils/lock.sh: default to system Ruby if available (#271)
This avoids weird issues with custom Rubies.

Closes #253.
2016-05-23 14:36:25 +01:00
Xu Cheng
ad8f50ec6d add utils/lock.sh
a Bash implementation of lock using `flock(2)`.
2016-05-12 15:36:46 +08:00