Allow at `install` (or `install --only-dependencies`) time to specify
that test dependencies should be installed. This will allow simplifying
code in `brew test-bot`.
This could also be made an environment variable if desired by
maintainers.
If you specify a formula more than once or it exists in the Cellar with
an alias name and the main name (e.g. `qt` and `qt5`) you can see the
same formula showing up more than once. Instead, resolve these output
lists of formulae such that they are unique based on their `name`. This
doesn't use `full_name` as it's `name` that's use for the `Cellar`.
These were formerly supported but as it has been a very long time since
32-bit software was necessary on macOS these have been deprecated with
a `brew audit` warning and a future `odeprecated`.
This is a step closer to better argument handling but for now just
fixes the issue in #1217 where it starts complaining about options like
`--build-from-source` being used.
These definitions are scattered throughout the codebase which makes it
hard to refactor them later (my goal is to move them outside of
HOMEBREW_LIBRARY). Unify their definitions for clearer code and easier
movement later.
Introduce `--fetch-HEAD` option. Without this option upgrade and
outdated never fetch latest upstream commit to detect if HEAD is
outdated -- tabs are used instead. However, if option is passed,
we fetch commit from upstream, which is more time consuming,
but we can be sure that version is up-to-date or outdated.
If we try to call `Formulary.from_keg(f, :head)` on the keg that
is not HEAD-keg itself, we don't need to update commit of
returned formula and should use just HEAD version with nil commit.
Same is true for `ARGV.resolved_formulae`
The fix changes behavior in same cases, but those cases were all either
broken or showed unexpected behavior. The new behavior is very simple:
- If an argument starts with `--<option-name>=`, return whatever comes
after the equals sign.
Prior to this change, `ARGV.value` showed some unexpected behavior:
- `ARGV.value("foo")` returned `nil` for `--foo=` because at least one
character needed to be present after the equals sign. (All other
option parser implementations I'm aware of allow for empty values.)
- `ARGV.value("bar")` returned `"baz"` for `--foo=--bar=baz` because the
regular expression was not anchored to the start of the argument.
- `ARGV.value("++")` raised an exception because the string wasn't
escaped for use in the regular expression. (An unlikely corner case.)
Closes#231.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.
Closes#66.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
Homebrew developers have the corresponding variable permanently set in
their environment and wanting to appear like a Homebrew developer for a
single invocation is exceedingly rare. Additionally, the option won't be
recognized by `bin/brew`. (It is also undocumented.)
Using `HOMEBREW_DEVELOPER=1 brew <command>` is still possible, and not
more inconvenient than passing the `--homebrew-developer` option.
ClosesHomebrew/homebrew#48322.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check
reinstate removed (doctor) check
Everything that used HOMEBREW_CELLAR/canonical_name
could point to something that doesn't exist because
loader_for tries to load new name formula if no old
name found. However there can be software installed
from path with the same name that renamed formulae
had and we still need to link/unlink/uninstall etc
that software. The solution is Formulary#to_rack
method that returns rack for given name.
- Add Formulary#to_rack
- Update ARGV.kegs
- Update cmd/switch