From 440fb7ee905714771061bcd967e6b0ff28807900 Mon Sep 17 00:00:00 2001 From: XuehaiPan Date: Tue, 28 Sep 2021 17:18:55 +0800 Subject: [PATCH 1/2] brew.sh: remove annoying prompts when homebrew/core not tapped --- Library/Homebrew/brew.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 50235a297e..3be0d36d88 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -347,7 +347,7 @@ export HOMEBREW_COMMAND_DEPTH="$((HOMEBREW_COMMAND_DEPTH + 1))" # This is set by the user environment. # shellcheck disable=SC2154 if [[ -n "${HOMEBREW_FORCE_BREWED_CURL}" && -x "${HOMEBREW_PREFIX}/opt/curl/bin/curl" ]] && - "${HOMEBREW_PREFIX}/opt/curl/bin/curl" --version >/dev/null + "${HOMEBREW_PREFIX}/opt/curl/bin/curl" --version &>/dev/null then HOMEBREW_CURL="${HOMEBREW_PREFIX}/opt/curl/bin/curl" elif [[ -n "${HOMEBREW_DEVELOPER}" && -x "${HOMEBREW_CURL_PATH}" ]] @@ -360,7 +360,7 @@ fi # This is set by the user environment. # shellcheck disable=SC2154 if [[ -n "${HOMEBREW_FORCE_BREWED_GIT}" && -x "${HOMEBREW_PREFIX}/opt/git/bin/git" ]] && - "${HOMEBREW_PREFIX}/opt/git/bin/git" --version >/dev/null + "${HOMEBREW_PREFIX}/opt/git/bin/git" --version &>/dev/null then HOMEBREW_GIT="${HOMEBREW_PREFIX}/opt/git/bin/git" elif [[ -n "${HOMEBREW_DEVELOPER}" && -x "${HOMEBREW_GIT_PATH}" ]] @@ -518,7 +518,7 @@ Your Git executable: $(unset git && type -p ${HOMEBREW_GIT})" HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION="2.13" unset HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH - HOMEBREW_CORE_REPOSITORY_ORIGIN="$("${HOMEBREW_GIT}" -C "${HOMEBREW_CORE_REPOSITORY}" remote get-url origin)" + HOMEBREW_CORE_REPOSITORY_ORIGIN="$("${HOMEBREW_GIT}" -C "${HOMEBREW_CORE_REPOSITORY}" remote get-url origin 2>/dev/null)" if [[ "${HOMEBREW_CORE_REPOSITORY_ORIGIN}" == "https://github.com/Homebrew/homebrew-core" ]] then # If the remote origin has been set to Homebrew/homebrew-core by the install script, From 8398be5cde653f4637a81af8f7e078ddacc49417 Mon Sep 17 00:00:00 2001 From: XuehaiPan Date: Tue, 28 Sep 2021 17:32:44 +0800 Subject: [PATCH 2/2] docs/Installation: update commands for untar-anywhere method --- docs/Homebrew-on-Linux.md | 11 ----------- docs/Installation.md | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/Homebrew-on-Linux.md b/docs/Homebrew-on-Linux.md index 23a99feca9..f7a0e0e910 100644 --- a/docs/Homebrew-on-Linux.md +++ b/docs/Homebrew-on-Linux.md @@ -78,17 +78,6 @@ You may need to install your own Ruby using your system package manager, a PPA, Homebrew does not currently support 32-bit x86 platforms. It would be possible for Homebrew to work on 32-bit x86 platforms with some effort. An interested and dedicated person could maintain a fork of Homebrew to develop support for 32-bit x86. -## Alternative Installation - -Extract or `git clone` Homebrew wherever you want. Use `/home/linuxbrew/.linuxbrew` if possible (to enable the use of binary packages). - -```sh -git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew -mkdir ~/.linuxbrew/bin -ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin -eval "$(~/.linuxbrew/bin/brew shellenv)" -``` - ## Homebrew on Linux Community - [@HomebrewOnLinux on Twitter](https://twitter.com/HomebrewOnLinux) diff --git a/docs/Installation.md b/docs/Installation.md index de7cefd2e7..ee86685e7b 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -53,6 +53,20 @@ here. *Pick another prefix at your peril!* mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew ``` +or + +```sh +git clone https://github.com/Homebrew/brew homebrew +``` + +then + +```sh +eval "$(homebrew/bin/brew shellenv)" +brew update --force --quiet +chmod -R go-w "$(brew --prefix)/share/zsh" +``` + ### Multiple installations Create a Homebrew installation wherever you extract the tarball. Whichever `brew` command is called is where the packages will be installed. You can use this as you see fit, e.g. a system set of libs in the default prefix and tweaked formulae for development in `~/homebrew`.