Adding a strict check for usage that should be using pkgshare.
Pulled onto two unique checks to provide a better problem message, with a
clearer solution, but open to thoughts.
* Use pkgshare instead of (share/"example")
* Use #{pkgshare} instead of #{share}/example
ClosesHomebrew/homebrew#47900.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Setting the `FC` environment variable allows the user to override the
default Fortran compiler. The `SharedEnvExtension#fortran` method then
checks whether any of `FCFLAGS` and `FFLAGS` environment variables are
set and, if not, suggests to use `--default-fortran-flags` when running
`brew install`. However, `--default-fortran-flags` never makes it to
`build.rb` (that is executed by `FormulaInstaller`) because the flag is
not whitelisted in `FormulaInstaller#sanitized_ARGV_options`.
This change rectifies this and thereby eliminates the confusing message.
FixesHomebrew/homebrew#47852.
Some (rather slow) checks should run after all other checks. Make that
more obvious by removing them from the sorted list of all checks and
then re-appending them to the resulting list. (Should be slightly more
efficient than the `<array>.reverse.uniq.reverse` incantation, though
that hardly matters given the cumulated run time of all the checks.)
Slightly extend the list after verifying what the slowest checks are for
various Homebrew installations (slowest check last).
ClosesHomebrew/homebrew#47753.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Use FormulaAuditor.audit_prefix_has_contents from audit.rb, which has
better logic.
ClosesHomebrew/homebrew#47678.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Abbreviations will be longer if needed to preserve uniqueness.
This makes it more consistent with `git rev-parse --short`,
https://github.com/Homebrew/homebrew/commits, etc.
For example, instead of:
Updated Homebrew from 40d1e9c2 to 90b9bdf4.
We see:
Updated Homebrew from 40d1e9c to 90b9bdf.
See 0c48248b6555353c8d60b61973639c8423ce586c for the original
introduction of eight-character abbreviations.
Those are created by the `ruby` formula in core and various Ruby
formulae from `homebrew/versions` and contain Gems and other stuff that
is to be retained across updates. Treat it like Python in this regard.
This avoids spurious output in `brew list --unbrewed` when a brewed
`ruby` is used to, e.g., install Gems.
ClosesHomebrew/homebrew#47750.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Treat it like the cache, i.e., if the logs directory is inside the
Homebrew prefix, skip it instead of listing all the logs.
This avoids spurious output in `brew list --unbrewed` when the Homebrew
logs directory is a subdirectory of the Homebrew prefix.
Putting the Ruby 1.8 we use to run tests on 10.9 into the PATH adversely
affects formulae with a Ruby dependency (possibly other formulae, too).
Remove this hack, as it is no longer needed.
ClosesHomebrew/homebrew#47694.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Particularly the `bundler` Gem requires the right Ruby binary to be in
the PATH to work correctly if the Ruby binary used to run Homebrew is
overridden via `HOMEBREW_RUBY_PATH` and thus intentionally not prefixed
to the PATH (as that would affect formulae with a Ruby dependency).
The workaround here is to prefix this path only when a Gem is activated
via `Homebrew.install_gem_setup_path!` (currently used in `brew man`,
`brew style`, and `brew tests`).
This new `.gitignore` format produces consistent/expected `git status`
output with Git <2.7.0, Git >2.7.0 and libgit2 0.23.4.
ClosesHomebrew/homebrew#47721.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This reverts commit 5896555e5352b5e4f16f583ea444942cd1fc56bd.
It caused header-location issue on dual-developer-tool systems for certain
formulae. Will need looking at again, but we'll probably have to try and
do this a different way.
ClosesHomebrew/homebrew#47668.
Tests shouldn't fail in case of an unavailable network or a deliberately
disabled access to the GitHub API.
ClosesHomebrew/homebrew#47670.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Some tests, that construct a Git repository for testing, will silently
fail if the global Git user isn't properly set up. There are valid use
cases for this, thus use a fixed commit author/committer for all tests
instead of relying on the user's configuration.
This tests all possible combinations of alpha, beta, RC, regular, and
patch versions. Also improves code coverage and partitions the version
comparison tests into more uniform chunks.
ClosesHomebrew/homebrew#47669.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This only affects the behavior of `brew update` while being on a branch
`feature` that doesn't track the upstream branch. For simplicity, the
upstream branch is assumed to be called `master` (`@upstream_branch` in
the code). Consider the following simplified commit history:
master origin/master (current state of remote)
| |
A---B---C---D---E---F
\
G---H---I
|
feature (HEAD)
If `origin/master` is equal to `master` and also points at commit `C`,
then `brew update` will update both `master` and `origin/master` to `F`
and report on the changes in the range `C..F`.
However, if `origin/master` is equal to `E` because some commits have
been already fetched with `git fetch origin`, then `brew update` will
recreate `master` from `origin/master` and then pull in the commits from
the remote to update both to `F`. Because `master` gets recreated from
a younger `origin/master`, the report will only contain changes from the
range `E..F` (thus omitting the changes from `C..E`).
This commit adjusts the logic to not recreate `master` if it can be
safely fast-forwarded to `origin/master` (the common case). This fixes
the problem from the second scenario and again reports on the desired
range `C..F`.
ClosesHomebrew/homebrew#46951.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
If the test fails above `formula_file`’s definition this line fails
because `formula_file` is `nil`.
ClosesHomebrew/homebrew#47663.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>