If the repository is set up by `brew update`, the remote URL is
https://github.com/mxcl/homebrew.git, but if it is set up by the install
script, the .git suffix is omitted.
Added checks on doctor.rb for:
* Missing git origin
* git origin not pointing at mxcl/homebrew
Tests use `git config --get remote.origin.url`.
Also added printout of origin to --config.rb.
FixesHomebrew/homebrew#14399.
ClosesHomebrew/homebrew#17117.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
It is important that dep equality corresponds to the name attribute, but
we may want to use the Comparable interface to sort them by installation
order in the future. Code that needs to sort them alphabetically should
just use sort_by.
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.
For example:
$ brew install graphviz pkg-config
==> Installing graphviz dependency: pkg-config
...
==> Installing graphviz
...
Error: pkg-config-0.27.1 already installed
We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.
FixesHomebrew/homebrew#16957.
`python --version` doesn't work in some (very) old versions of
python. While I doubt this is going to come up very often, it's
theoretically possible someone has an old python first in their
path. (python -V works on all versions I'm aware of, including
python3, and comes before --version in the --help anyway.)
Also skips the warning in case the regexp matches nothing, which
probably shouldn't happen. But if it does we shouldn't produce the
wrong warning.
Two issues were preventing `brew upgrade` from functioning properly:
- `Tab.for_formula` was used to recover options from prior installs. The
problem is that during an upgrade `for_formula` will be directed to a
non-existant install of the newer version and thus returns a forged tab
claiming no options were invoked.
- The assignment to `installer.install_bottle` requires parenthesis in order
to function properly.
This code makes assumptions about the existence of prefix which are
valid in the context of the installer, but not necessarily in the
context of `brew info`, thus `brew info` on an outdated formula errors
out.
This reverts commit e5b53dd64b769b67805d1054d906f7083939d905.
We support three configurations: Xcode-only, CLT-only, and Xcode with
CLT. Our configuration output should correctly reflect this.
While MacOS::Xcode.version has to continue to return a guess if Xcode is
not installed in order to maintain backwards compatibility, this is an
implementation detail that we don't need to expose to the user. And it
makes `brew --config` output confusing.
So let's only print the "Xcode" line when an actual Xcode installation
is present. This makes it easy to quickly figure out which of the three
possible configurations the user is running.
Addresses Homebrew/homebrew#14941, more or less.
* Use version compare to only remove kegs with lower version than the
current one, not higher version which might be from someone's
branch.
* Do the same for cache cleanup.
- Be conservative so that if a name detected from cache file is not
the same as its formula then don't clean it.
ClosesHomebrew/homebrew#15914.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Enumerable#one? is not available under Ruby 1.8.6. Further, we really
want #any? here, as setting both HOME and CURL_HOME can trigger a false
negative.
FixesHomebrew/homebrew#15883.