From 1b6a200809ce5963795a0d60bacd72dc40d7692e Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Tue, 10 May 2016 20:16:25 +0800 Subject: [PATCH] update: use lock Closes #181. Signed-off-by: Xu Cheng --- Library/Homebrew/cmd/update.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 9679c0f8e2..0ad66b8b44 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -5,6 +5,8 @@ #: If `--merge` is specified then `git merge` is used to include updates #: (rather than `git rebase`). +source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh" + brew() { "$HOMEBREW_BREW_FILE" "$@" } @@ -307,6 +309,9 @@ EOS # ensure GIT_CONFIG is unset as we need to operate on .git/config unset GIT_CONFIG + # only allow one instance of brew update + lock update + chdir "$HOMEBREW_REPOSITORY" git_init_if_necessary # rename Taps directories