update.sh: all configurable HOMEBREW_AUTO_UPDATE_SECS.

This commit is contained in:
Mike McQuaid 2016-08-10 14:18:39 +01:00
parent 1a240cd52a
commit 0c6e307eef

View File

@ -314,6 +314,11 @@ EOS
set -x set -x
fi fi
if [[ -z "$HOMEBREW_AUTO_UPDATE_SECS" ]]
then
HOMEBREW_AUTO_UPDATE_SECS="60"
fi
# check permissions # check permissions
if [[ "$HOMEBREW_PREFIX" = "/usr/local" && ! -w /usr/local ]] if [[ "$HOMEBREW_PREFIX" = "/usr/local" && ! -w /usr/local ]]
then then
@ -395,7 +400,7 @@ EOS
if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]] if [[ -n "$HOMEBREW_UPDATE_PREINSTALL" ]]
then then
# Skip taps checked/fetched recently # Skip taps checked/fetched recently
[[ -n "$(find "$DIR/.git/FETCH_HEAD" -type f -mtime -60s 2>/dev/null)" ]] && exit [[ -n "$(find "$DIR/.git/FETCH_HEAD" -type f -mtime -"${HOMEBREW_AUTO_UPDATE_SECS}"s 2>/dev/null)" ]] && exit
# Skip taps without formulae (but always update Homebrew/brew and Homebrew/homebrew-core) # Skip taps without formulae (but always update Homebrew/brew and Homebrew/homebrew-core)
if [[ "$DIR" != "$HOMEBREW_REPOSITORY" && if [[ "$DIR" != "$HOMEBREW_REPOSITORY" &&