-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle a too old system Git on OS X 10.8 and below #3837
Conversation
@@ -390,7 +390,7 @@ EOS | |||
brew install curl | |||
fi | |||
|
|||
if ! git --version >/dev/null 2>&1 | |||
if [[ -n "$HOMEBREW_SYSTEM_GIT_TOO_OLD" ]] || ! git --version >/dev/null 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>/dev/null 2>&1
can be changed here and on line 398
to &>/dev/null
. It does the same, yet is less verbose and cryptic.
I was going to submit a PR but then noticed Library/Homebrew/readall.rb
has something similar on line 79
, but there it is reversed (and it makes a difference), so you was unsure if you wanted to keep 2>&1
here for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitorgalvao 👍 to a PR for that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that &>/dev/null
is a bash-ism and is not portable to other POSIX shells. In particular, the default shell /bin/sh
on Ubuntu is Dash, which does not implement &>/dev/null
. It is interpreted as redirecting stdout to /dev/null (>/dev/null
) and backgrounding the process (&
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[
is also a bashism but used extensively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjackman Best way around that is to make sure the shell is defined at the top. That way there won’t be surprises (especially since macOS will be forever stuck in Bash 3).
But after I’ve made the initial comment, I’ve noticed the rest of this script did already use &>/dev/null
, so if this change is reverted, we should also make sure to replace those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. I see now that bin/brew
is #!/bin/bash
, so all is good.
I'm on Mac OS X 10.7.5 Lion. Shouldn't I be able to install homebrew from scratch and have it resolve the SSL issue? Or do I need to manually uninstall the current broken homebrew first? `$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Press RETURN to continue or any other key to abort |
We don't support macOS versions below 10.11. If you can get it to work and submit a pull request we'll review and consider accepting it. |
@taa1 Try (untested)… git clone --depth=1 https://github.com/Homebrew/brew /usr/local/Homebrew
ln -s ../Homebrew/bin/brew /usr/local/bin/
export HOMEBREW_FORCE_BREWED_CURL=1
brew update |
You need to use git:// protocol. |
Thank you @sjackman and @ilovezfs for trying to help. I continue to get the SSL error. In addition to @sjackman's suggestion, I've also tried:
My most recent attempt to install from scratch:
The errors above suggest deleting /Users/taa/Library/Caches/Homebrew/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz but this made no difference. If I now try @sjackman's suggestion:
I don't know enough about git to even formulate a solution for consideration as a PR. So... trying to install Homebrew on Mac OS X 10.7 fails in a very spectacular way ever since Weak cryptographic standards removed | The GitHub Blog. |
@ilovezfs, I don't know what you mean. |
You likely won't be able to use the usual git clone --depth=1 git://github.com/Homebrew/brew /usr/local/Homebrew
ln -s ../Homebrew/bin/brew /usr/local/bin/
export HOMEBREW_FORCE_BREWED_CURL=1
brew update |
You also need to clone Homebrew/homebrew-core with git:// |
git clone --depth=1 git://github.com/Homebrew/brew /usr/local/Homebrew
git clone --depth=1 git://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
ln -s ../Homebrew/bin/brew /usr/local/bin/
export HOMEBREW_FORCE_BREWED_CURL=1
brew update |
I'm making progress... I think... no SSL errors this time....
How do I fix the |
I'm afraid I don't know the answer to that question. |
I decided to create a virtual machine with a fresh install of Lion 10.7.5, XCode 4.6.3 and its command line tools. This means it is a clean slate with the Apple-provided git 1.7.12.4 (Apple Git-37), perl 5.12.3, and curl 7.21.4. Results are here, scroll down to the highlighted lines starting at line 79: https://pastebin.com/hK5Ugm00 TL;DR: curl SSL errors accessing: Does this mean |
It looks as though the
We need to change the As a workaround, you can download this file by some other method, and place it at the location indicated by… ❯❯❯ brew --cache -s curl
~/Library/Caches/Homebrew/curl-7.59.0.tar.bz2 |
Looks like http://curl.mirror.anstey.ca/curl-7.59.0.tar.bz2 is not redirecting |
Needed for GitHub since:
https://github.com/blog/2507-weak-cryptographic-standards-removed