2016-01-10 20:28:52 +00:00
|
|
|
brew() {
|
|
|
|
"$HOMEBREW_BREW_FILE" "$@"
|
|
|
|
}
|
|
|
|
|
2016-01-28 18:48:44 +08:00
|
|
|
git() {
|
|
|
|
[[ -n "$HOMEBREW_GIT" ]] || odie "HOMEBREW_GIT is unset!"
|
|
|
|
"$HOMEBREW_GIT" "$@"
|
|
|
|
}
|
|
|
|
|
2016-01-10 20:28:52 +00:00
|
|
|
which_git() {
|
2016-01-28 18:48:44 +08:00
|
|
|
local git_path
|
2016-01-21 18:44:32 +08:00
|
|
|
local active_developer_dir
|
|
|
|
|
2016-01-28 18:48:44 +08:00
|
|
|
if [[ -n "$HOMEBREW_GIT" ]]
|
|
|
|
then
|
|
|
|
git_path="$HOMEBREW_GIT"
|
|
|
|
elif [[ -n "$GIT" ]]
|
|
|
|
then
|
|
|
|
git_path="$GIT"
|
|
|
|
else
|
|
|
|
git_path="git"
|
|
|
|
fi
|
|
|
|
|
|
|
|
git_path="$(which "$git_path" 2>/dev/null)"
|
|
|
|
|
|
|
|
if [[ -n "$git_path" ]]
|
|
|
|
then
|
|
|
|
git_path="$(chdir "${git_path%/*}" && pwd -P)/${git_path##*/}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "$HOMEBREW_OSX" && "$git_path" = "/usr/bin/git" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
|
|
|
active_developer_dir="$('/usr/bin/xcode-select' -print-path 2>/dev/null)"
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ -n "$active_developer_dir" && -x "$active_developer_dir/usr/bin/git" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-28 18:48:44 +08:00
|
|
|
git_path="$active_developer_dir/usr/bin/git"
|
2016-01-10 20:28:52 +00:00
|
|
|
else
|
2016-01-28 18:48:44 +08:00
|
|
|
git_path=""
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
fi
|
2016-01-28 18:48:44 +08:00
|
|
|
echo "$git_path"
|
2016-01-10 20:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
git_init_if_necessary() {
|
2016-01-28 17:11:35 +08:00
|
|
|
set -e
|
|
|
|
trap '{ rm -rf .git; exit 1; }' EXIT
|
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ ! -d ".git" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-28 19:32:41 +08:00
|
|
|
git init
|
2016-01-10 20:28:52 +00:00
|
|
|
git config --bool core.autocrlf false
|
|
|
|
git config remote.origin.url https://github.com/Homebrew/homebrew.git
|
|
|
|
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
|
2016-01-28 17:11:35 +08:00
|
|
|
git fetch origin
|
|
|
|
git reset --hard origin/master
|
|
|
|
SKIP_FETCH_HOMEBREW_REPOSITORY=1
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-28 17:11:35 +08:00
|
|
|
set +e
|
|
|
|
trap - EXIT
|
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ "$(git remote show origin -n)" = *"mxcl/homebrew"* ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-28 17:11:35 +08:00
|
|
|
git remote set-url origin https://github.com/Homebrew/homebrew.git &&
|
2016-01-10 20:28:52 +00:00
|
|
|
git remote set-url --delete origin ".*mxcl\/homebrew.*"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2016-01-20 21:41:48 +08:00
|
|
|
rename_taps_dir_if_necessary() {
|
|
|
|
local tap_dir
|
2016-01-21 18:44:32 +08:00
|
|
|
local tap_dir_basename
|
|
|
|
local user
|
|
|
|
local repo
|
|
|
|
|
2016-01-20 21:41:48 +08:00
|
|
|
for tap_dir in "$HOMEBREW_LIBRARY"/Taps/*
|
|
|
|
do
|
|
|
|
[[ -d "$tap_dir/.git" ]] || continue
|
|
|
|
tap_dir_basename="${tap_dir##*/}"
|
|
|
|
if [[ "$tap_dir_basename" = *"-"* ]]
|
|
|
|
then
|
|
|
|
# only replace the *last* dash: yes, tap filenames suck
|
|
|
|
user="$(echo "${tap_dir_basename%-*}" | tr "[:upper:]" "[:lower:]")"
|
|
|
|
repo="$(echo "${tap_dir_basename:${#user}+1}" | tr "[:upper:]" "[:lower:]")"
|
|
|
|
mkdir -p "$HOMEBREW_LIBRARY/Taps/$user"
|
|
|
|
mv "$tap_dir", "$HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo"
|
|
|
|
|
|
|
|
if [[ ${#${tap_dir_basename//[^\-]}} -gt 1 ]]
|
|
|
|
then
|
|
|
|
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2
|
|
|
|
echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>. " >&2
|
|
|
|
echo "$tap_dir is an incorrect Tap path." >&2
|
|
|
|
echo "So you may need to rename it to $HOMEBREW_LIBRARY/Taps/<someuser>/homebrew-<sometap> manually." >&2
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2016-01-10 20:28:52 +00:00
|
|
|
repo_var() {
|
2016-01-21 18:44:32 +08:00
|
|
|
local repo_var
|
|
|
|
|
|
|
|
repo_var="$1"
|
2016-01-20 19:41:42 +08:00
|
|
|
if [[ "$repo_var" = "$HOMEBREW_REPOSITORY" ]]
|
|
|
|
then
|
|
|
|
repo_var=""
|
|
|
|
else
|
|
|
|
repo_var="${repo_var#"$HOMEBREW_LIBRARY/Taps"}"
|
|
|
|
repo_var="$(echo -n "$repo_var" | tr -C "A-Za-z0-9" "_" | tr "[:lower:]" "[:upper:]")"
|
|
|
|
fi
|
|
|
|
echo "$repo_var"
|
2016-01-10 20:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream_branch() {
|
|
|
|
local upstream_branch
|
2016-01-21 18:44:32 +08:00
|
|
|
|
2016-01-20 20:29:47 +08:00
|
|
|
upstream_branch="$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null)"
|
|
|
|
upstream_branch="${upstream_branch#refs/remotes/origin/}"
|
2016-01-20 19:51:48 +08:00
|
|
|
[[ -z "$upstream_branch" ]] && upstream_branch="master"
|
2016-01-10 20:28:52 +00:00
|
|
|
echo "$upstream_branch"
|
|
|
|
}
|
|
|
|
|
|
|
|
read_current_revision() {
|
|
|
|
git rev-parse -q --verify HEAD
|
|
|
|
}
|
|
|
|
|
|
|
|
pop_stash() {
|
2016-01-20 19:51:48 +08:00
|
|
|
[[ -z "$STASHED" ]] && return
|
2016-01-21 18:53:42 +08:00
|
|
|
git stash pop "${QUIET_ARGS[@]}"
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ -n "$HOMEBREW_VERBOSE" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
|
|
|
echo "Restoring your stashed changes to $DIR:"
|
|
|
|
git status --short --untracked-files
|
|
|
|
fi
|
|
|
|
unset STASHED
|
|
|
|
}
|
|
|
|
|
|
|
|
pop_stash_message() {
|
2016-01-20 19:51:48 +08:00
|
|
|
[[ -z "$STASHED" ]] && return
|
2016-01-10 20:28:52 +00:00
|
|
|
echo "To restore the stashed changes to $DIR run:"
|
|
|
|
echo " 'cd $DIR && git stash pop'"
|
|
|
|
unset STASHED
|
|
|
|
}
|
|
|
|
|
|
|
|
reset_on_interrupt() {
|
2016-01-20 22:58:45 +08:00
|
|
|
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
|
|
|
|
then
|
|
|
|
git checkout "$INITIAL_BRANCH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "$INITIAL_REVISION" ]]
|
|
|
|
then
|
2016-01-21 18:53:42 +08:00
|
|
|
git reset --hard "$INITIAL_REVISION" "${QUIET_ARGS[@]}"
|
2016-01-20 22:58:45 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
|
|
|
pop_stash
|
|
|
|
else
|
|
|
|
pop_stash_message
|
|
|
|
fi
|
2016-01-20 22:58:45 +08:00
|
|
|
|
|
|
|
exit 130
|
2016-01-10 20:28:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pull() {
|
2016-01-21 18:44:32 +08:00
|
|
|
local DIR
|
|
|
|
local TAP_VAR
|
|
|
|
|
|
|
|
DIR="$1"
|
2016-01-10 20:28:52 +00:00
|
|
|
cd "$DIR" || return
|
|
|
|
TAP_VAR=$(repo_var "$DIR")
|
|
|
|
unset STASHED
|
|
|
|
|
|
|
|
# The upstream repository's default branch may not be master;
|
|
|
|
# check refs/remotes/origin/HEAD to see what the default
|
|
|
|
# origin branch name is, and use that. If not set, fall back to "master".
|
|
|
|
INITIAL_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)"
|
|
|
|
UPSTREAM_BRANCH="$(upstream_branch)"
|
|
|
|
|
|
|
|
# Used for testing purposes, e.g., for testing formula migration after
|
|
|
|
# renaming it in the currently checked-out branch. To test run
|
|
|
|
# "brew update --simulate-from-current-branch"
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ -n "$HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-21 13:58:54 +08:00
|
|
|
INITIAL_REVISION="$(git rev-parse -q --verify "$UPSTREAM_BRANCH")"
|
2016-01-10 20:28:52 +00:00
|
|
|
CURRENT_REVISION="$(read_current_revision)"
|
2016-01-21 13:58:54 +08:00
|
|
|
export HOMEBREW_UPDATE_BEFORE"$TAP_VAR"="$INITIAL_REVISION"
|
|
|
|
export HOMEBREW_UPDATE_AFTER"$TAP_VAR"="$CURRENT_REVISION"
|
2016-01-10 20:28:52 +00:00
|
|
|
if ! git merge-base --is-ancestor "$INITIAL_REVISION" "$CURRENT_REVISION"
|
|
|
|
then
|
2016-02-12 13:09:13 +00:00
|
|
|
odie "Your $DIR HEAD is not a descendant of $UPSTREAM_BRANCH!"
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2016-01-21 14:01:51 +08:00
|
|
|
trap reset_on_interrupt SIGINT
|
|
|
|
|
|
|
|
if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]]
|
|
|
|
then
|
|
|
|
if [[ -n "$HOMEBREW_VERBOSE" ]]
|
|
|
|
then
|
|
|
|
echo "Stashing uncommitted changes to $DIR."
|
|
|
|
git status --short --untracked-files=all
|
|
|
|
fi
|
2016-02-18 10:38:30 +00:00
|
|
|
git merge --abort &>/dev/null
|
2016-01-21 14:01:51 +08:00
|
|
|
git -c "user.email=brew-update@localhost" \
|
|
|
|
-c "user.name=brew update" \
|
2016-01-21 18:53:42 +08:00
|
|
|
stash save --include-untracked "${QUIET_ARGS[@]}"
|
|
|
|
git reset --hard "${QUIET_ARGS[@]}"
|
2016-01-21 14:01:51 +08:00
|
|
|
STASHED="1"
|
|
|
|
fi
|
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ "$INITIAL_BRANCH" != "$UPSTREAM_BRANCH" && -n "$INITIAL_BRANCH" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
|
|
|
# Recreate and check out `#{upstream_branch}` if unable to fast-forward
|
|
|
|
# it to `origin/#{@upstream_branch}`. Otherwise, just check it out.
|
|
|
|
if git merge-base --is-ancestor "$UPSTREAM_BRANCH" "origin/$UPSTREAM_BRANCH" &>/dev/null
|
|
|
|
then
|
2016-01-21 18:53:42 +08:00
|
|
|
git checkout --force "$UPSTREAM_BRANCH" "${QUIET_ARGS[@]}"
|
2016-01-10 20:28:52 +00:00
|
|
|
else
|
2016-01-21 18:53:42 +08:00
|
|
|
git checkout --force -B "$UPSTREAM_BRANCH" "origin/$UPSTREAM_BRANCH" "${QUIET_ARGS[@]}"
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
INITIAL_REVISION="$(read_current_revision)"
|
2016-01-21 13:58:54 +08:00
|
|
|
export HOMEBREW_UPDATE_BEFORE"$TAP_VAR"="$INITIAL_REVISION"
|
2016-01-10 20:28:52 +00:00
|
|
|
|
|
|
|
# ensure we don't munge line endings on checkout
|
|
|
|
git config core.autocrlf false
|
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ -n "$HOMEBREW_REBASE" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-21 18:53:42 +08:00
|
|
|
git rebase "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH"
|
2016-01-10 20:28:52 +00:00
|
|
|
else
|
2016-02-18 10:38:30 +00:00
|
|
|
git merge --no-edit --ff "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH" \
|
|
|
|
--strategy=recursive \
|
|
|
|
--strategy-option=ours \
|
|
|
|
--strategy-option=ignore-all-space
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-21 13:58:54 +08:00
|
|
|
export HOMEBREW_UPDATE_AFTER"$TAP_VAR"="$(read_current_revision)"
|
2016-01-10 20:28:52 +00:00
|
|
|
|
2016-01-20 22:58:45 +08:00
|
|
|
trap '' SIGINT
|
|
|
|
|
2016-02-08 23:18:21 -08:00
|
|
|
pop_stash_message
|
2016-01-20 22:58:45 +08:00
|
|
|
|
|
|
|
trap - SIGINT
|
2016-01-10 20:28:52 +00:00
|
|
|
}
|
|
|
|
|
2016-02-12 13:25:37 +00:00
|
|
|
homebrew-update() {
|
2016-01-21 18:44:32 +08:00
|
|
|
local option
|
|
|
|
local DIR
|
|
|
|
local UPSTREAM_BRANCH
|
|
|
|
|
|
|
|
for option in "$@"
|
2016-01-10 20:28:52 +00:00
|
|
|
do
|
2016-01-21 18:44:32 +08:00
|
|
|
case "$option" in
|
2016-02-19 17:02:20 +08:00
|
|
|
# TODO: - `brew update --help` should display update subcommand help
|
|
|
|
--help) brew --help; exit $? ;;
|
2016-01-10 20:28:52 +00:00
|
|
|
--verbose) HOMEBREW_VERBOSE=1 ;;
|
|
|
|
--debug) HOMEBREW_DEBUG=1;;
|
|
|
|
--rebase) HOMEBREW_REBASE=1 ;;
|
|
|
|
--simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;;
|
|
|
|
--*) ;;
|
2016-01-21 18:36:05 +08:00
|
|
|
-*)
|
2016-01-21 18:44:32 +08:00
|
|
|
[[ "$option" = *v* ]] && HOMEBREW_VERBOSE=1;
|
|
|
|
[[ "$option" = *d* ]] && HOMEBREW_DEBUG=1;
|
2016-01-21 18:36:05 +08:00
|
|
|
;;
|
2016-01-10 20:28:52 +00:00
|
|
|
*)
|
2016-01-20 20:26:28 +08:00
|
|
|
odie <<-EOS
|
|
|
|
This command updates brew itself, and does not take formula names.
|
|
|
|
Use 'brew upgrade <formula>'.
|
|
|
|
EOS
|
2016-01-10 20:28:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ -n "$HOMEBREW_DEBUG" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check permissions
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ "$HOMEBREW_PREFIX" = "/usr/local" && ! -w /usr/local ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-20 20:26:28 +08:00
|
|
|
odie "/usr/local must be writable!"
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ ! -w "$HOMEBREW_REPOSITORY" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-20 20:26:28 +08:00
|
|
|
odie "$HOMEBREW_REPOSITORY must be writable!"
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-28 18:48:44 +08:00
|
|
|
HOMEBREW_GIT="$(which_git)"
|
|
|
|
if [[ -z "$HOMEBREW_GIT" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
|
|
|
brew install git
|
2016-01-28 18:48:44 +08:00
|
|
|
HOMEBREW_GIT="$(which_git)"
|
|
|
|
if [[ -z "$HOMEBREW_GIT" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-20 20:26:28 +08:00
|
|
|
odie "Git must be installed and in your PATH!"
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
fi
|
2016-02-12 12:54:47 +00:00
|
|
|
export GIT_TERMINAL_PROMPT="0"
|
|
|
|
export GIT_ASKPASS="false"
|
|
|
|
export GIT_SSH_COMMAND="ssh -oBatchMode=yes"
|
2016-01-10 20:28:52 +00:00
|
|
|
|
2016-01-20 19:51:48 +08:00
|
|
|
if [[ -z "$HOMEBREW_VERBOSE" ]]
|
2016-01-10 20:28:52 +00:00
|
|
|
then
|
2016-01-21 18:53:42 +08:00
|
|
|
QUIET_ARGS=(-q)
|
|
|
|
else
|
|
|
|
QUIET_ARGS=()
|
2016-01-10 20:28:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# ensure GIT_CONFIG is unset as we need to operate on .git/config
|
|
|
|
unset GIT_CONFIG
|
|
|
|
|
2016-01-20 20:26:28 +08:00
|
|
|
chdir "$HOMEBREW_REPOSITORY"
|
2016-01-10 20:28:52 +00:00
|
|
|
git_init_if_necessary
|
2016-01-20 21:41:48 +08:00
|
|
|
# rename Taps directories
|
|
|
|
# this procedure will be removed in the future if it seems unnecessary
|
|
|
|
rename_taps_dir_if_necessary
|
2016-01-10 20:28:52 +00:00
|
|
|
|
2016-01-21 13:32:22 +08:00
|
|
|
# kill all of subprocess on interrupt
|
|
|
|
trap '{ pkill -P $$; wait; exit 130; }' SIGINT
|
|
|
|
|
2016-01-10 20:28:52 +00:00
|
|
|
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
|
|
|
|
do
|
2016-01-20 19:51:48 +08:00
|
|
|
[[ -d "$DIR/.git" ]] || continue
|
2016-01-28 17:11:35 +08:00
|
|
|
[[ -n "$SKIP_FETCH_HOMEBREW_REPOSITORY" && "$DIR" = "$HOMEBREW_REPOSITORY" ]] && continue
|
2016-01-10 20:28:52 +00:00
|
|
|
cd "$DIR" || continue
|
|
|
|
UPSTREAM_BRANCH="$(upstream_branch)"
|
|
|
|
# the refspec ensures that the default upstream branch gets updated
|
2016-02-12 13:09:13 +00:00
|
|
|
(
|
2016-02-18 10:41:09 +00:00
|
|
|
UPSTREAM_REPOSITORY_URL="$(git config remote.origin.url)"
|
|
|
|
if [[ "$UPSTREAM_REPOSITORY_URL" = "https://github.com/"* ]]
|
|
|
|
then
|
|
|
|
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY_URL#https://github.com/}"
|
|
|
|
UPSTREAM_REPOSITORY="${UPSTREAM_REPOSITORY%.git}"
|
|
|
|
UPSTREAM_BRANCH_LOCAL_SHA="$(git rev-parse "refs/remotes/origin/$UPSTREAM_BRANCH")"
|
|
|
|
# Only try to `git fetch` when the upstream branch is at a different SHA
|
|
|
|
# (so the API does not return 304: unmodified).
|
|
|
|
UPSTREAM_SHA_HTTP_CODE="$(curl --silent '--max-time' 3 \
|
|
|
|
--output /dev/null --write-out "%{http_code}" \
|
|
|
|
-H "Accept: application/vnd.github.chitauri-preview+sha" \
|
|
|
|
-H "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
|
|
|
|
"https://api.github.com/repos/$UPSTREAM_REPOSITORY/commits/$UPSTREAM_BRANCH")"
|
|
|
|
[[ "$UPSTREAM_SHA_HTTP_CODE" = "304" ]] && exit
|
|
|
|
fi
|
|
|
|
|
2016-03-08 18:20:45 +08:00
|
|
|
git fetch --force "${QUIET_ARGS[@]}" origin \
|
2016-02-12 13:09:13 +00:00
|
|
|
"refs/heads/$UPSTREAM_BRANCH:refs/remotes/origin/$UPSTREAM_BRANCH" || \
|
|
|
|
odie "Fetching $DIR failed!"
|
|
|
|
) &
|
2016-01-10 20:28:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
wait
|
2016-01-21 13:32:22 +08:00
|
|
|
trap - SIGINT
|
2016-01-10 20:28:52 +00:00
|
|
|
|
|
|
|
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
|
|
|
|
do
|
2016-01-20 19:51:48 +08:00
|
|
|
[[ -d "$DIR/.git" ]] || continue
|
2016-01-10 20:28:52 +00:00
|
|
|
pull "$DIR"
|
|
|
|
done
|
|
|
|
|
2016-01-20 20:26:28 +08:00
|
|
|
chdir "$HOMEBREW_REPOSITORY"
|
2016-01-10 20:28:52 +00:00
|
|
|
brew update-report "$@"
|
|
|
|
return $?
|
|
|
|
}
|