23157 Commits

Author SHA1 Message Date
Carlo Cabrera
78ad5a870c
formula_installer: add tap_audit_exception stub
`FormulaInstaller` calls `audit_installed` at install time, which
invokes methods in `FormulaCellarChecks`. One of these methods makes a
call to `tap_audit_exception` (cf. #11750), but this method isn't
visible in `FormulaInstaller`.

Instead of trying to replicate the logic of `tap_audit_exception` in
`FormulaAuditor` (or trying to initialise an instance of one to make the
call to `FormulaAuditor`'s implementation of it), let's just implement a
stub that assumes an exception always exists.

I'll need to think a bit about whether this is the right fix for this,
but currently the missing method error is blocking PRs in Homebrew/core,
so let's go with this for now. [1]

[1] e.g. Homebrew/homebrew-core#81388, Homebrew/homebrew-core#81582
2021-07-21 15:46:04 +08:00
Carlo Cabrera
eb27ba4832
Merge pull request #11750 from carlocab/audit-archs-fixed
formula_cellar_checks: handle universal binaries in `check_binary_arches`
2021-07-21 12:45:03 +08:00
Carlo Cabrera
a29098c813
Use #partition to simplify extracting compatible_universal_binaries 2021-07-21 12:05:54 +08:00
Sam Ford
e125e2b3ef
Merge pull request #11746 from samford/livecheck/sourceforge-do-not-modify-rss-urls
Sourceforge: Do not modify RSS URLs
2021-07-20 18:17:39 -04:00
Carlo Cabrera
1d5bc01f4e
Merge pull request #11734 from carlocab/deprecate-autosquash
dev-cmd/pr-publish: pass `--autosquash` by default
2021-07-20 19:47:01 +08:00
Carlo Cabrera
699051b3c3
Use #present? instead of #any? 2021-07-20 18:53:53 +08:00
Carlo Cabrera
663aee0a67
Fix style
The linter complained about useless assignment to
`universal_binaries_expected`. It wasn't useless, but ok.
2021-07-20 18:48:40 +08:00
Carlo Cabrera
239fd06728
Enforce universal binary check only for Homebrew/core
Also, prefer `if` to `unless`.
2021-07-20 18:40:19 +08:00
Mike McQuaid
acc5d68654
Merge pull request #11731 from gromgit/extract/fix_load
extract: ignore syntax errors during load
2021-07-20 11:15:10 +01:00
Carlo Cabrera
252453655e
Merge pull request #11748 from carlocab/search-help-text 2021-07-20 18:14:40 +08:00
Mike McQuaid
41d62e9084
Merge pull request #11739 from Logicer16/dont-ask-for-a-PAT-if-one-already-exists
GitHub/API: Don't ask for a PAT if one already exists
2021-07-20 10:48:06 +01:00
Carlo Cabrera
55cc1eb8b0
Check tap_audit_exception only if tap is present 2021-07-20 13:08:15 +08:00
Carlo Cabrera
1678a3785e
Fix logic in check_binary_arches 2021-07-20 12:35:09 +08:00
Carlo Cabrera
7b74730f9d
formula_cellar_checks: fix universal binary handling
The `check_binary_arches` audit will fail any formula that produces
universal binaries. We have a handful of formulae in Homebrew/core that
do this (see any formula that does `ENV.permit_arch_flags`, for
example). Moreover, some third party taps may have their own formulae
that build universal binaries.

I've updated the check so that it ignores a formula that produces
universal binaries whenever the formula is in the appropriate allowlist.
We'll need to create one in Homebrew/core for the handful of formulae
that do (expectedly) build universal binaries.

If we don't want to maintain an allowlist, we can easily modify this to
pass over any formulae that builds compatible universal binaries.

I've also fixed the spacing of the error this audit produces whenever
there is more than one file that fails the audit.
2021-07-20 12:15:59 +08:00
Logicer
7beb1f227c
Update Library/Homebrew/utils/github/api.rb
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2021-07-20 12:06:04 +10:00
Adrian Ho
a14d8924de extract: ignore syntax errors during load 2021-07-20 09:57:04 +08:00
Carlo Cabrera
ae788550f9
Show replacement command in odeprecated
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2021-07-20 09:39:51 +08:00
Carlo Cabrera
349a485886
Merge pull request #11742 from carlocab/pour-default-prefix
formula: add `:default_prefix` as a standard `pour_bottle?` requirement
2021-07-20 09:34:58 +08:00
Carlo Cabrera
219fffb700
cmd/search: tweak help text
See https://github.com/Homebrew/brew/pull/11736#discussion_r672233442.
2021-07-20 09:32:37 +08:00
Carlo Cabrera
9370c7cca7
Fix logic error in pr-automerge
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2021-07-20 09:28:38 +08:00
Carlo Cabrera
4d77e01273
Remove on_macos block 2021-07-20 09:07:09 +08:00
Carlo Cabrera
608e501756
Merge pull request #11736 from carlocab/search-repology
cmd/search: add repology
2021-07-20 08:03:13 +08:00
Logicer
ed4f840a67
Fix style 2021-07-20 09:22:34 +10:00
Logicer
0c6f5ab233
Put API.credentials bit into separate variable 2021-07-20 09:18:16 +10:00
Sam Ford
7b864e0aaa
Sourceforge: Do not modify RSS URLs
This allows a `livecheck` block to check the RSS feed for a given
path in a SourceForge project. For example:
https://sourceforge.net/projects/example/rss?path=/directory
2021-07-19 15:15:27 -04:00
Carlo Cabrera
1ceaa2ebd3
formula: add :default_prefix as a standard pour_bottle? requirement
See discussion at Homebrew/homebrew-core#81408.
2021-07-19 20:26:02 +08:00
Carlo Cabrera
16b01d6e01
Merge pull request #11737 from carlocab/audit-arches
formula_cellar_checks: check keg for mismatched arches
2021-07-19 20:15:08 +08:00
Logicer
71b61d28d1 Fix Style 2021-07-19 12:09:23 +10:00
ylht
75a38b7187 refactor the format 2021-07-19 10:02:19 +08:00
ylht
e5986dba6c cmd/doctor: repair xattr not find 2021-07-19 09:55:30 +08:00
Carlo Cabrera
654d10d6d3
Fix more typos
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2021-07-19 09:43:08 +08:00
Logicer
06f415e819 Dont ask to create PAT if one already exists 2021-07-19 10:28:11 +10:00
Logicer
5b7921ff68 Add support for GitHub Oauth tokens from keychain 2021-07-18 21:47:11 +10:00
Carlo Cabrera
d696250ddb
Fix ELF architecture offset for x86_64
The current offset results in ELF binaries returning an `#arch` of
`:dunno`.

Also, skip the `check_binary_arches` audit on the generic OS.
2021-07-18 16:55:57 +08:00
Carlo Cabrera
171859d3ad
Fix typos
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
2021-07-18 15:54:52 +08:00
Carlo Cabrera
3325b79726
dev-cmd/pr-automerge: deprecate --autosquash 2021-07-18 15:36:19 +08:00
Carlo Cabrera
488ccfdf70
formula_cellar_checks: check keg for mismatched arches
There have been a few instances I've noticed that we've been silently
installing binaries built for x86_64 on ARM. There's probably more that
I haven't found yet, so it seems useful to check this with an audit.
2021-07-18 11:44:37 +08:00
Carlo Cabrera
822170a766
cmd/search: add repology
I often find myself checking Repology to quickly reference how other
package managers handle certain things, so it seems useful to be able to
do so with `brew search`.

While we're here, let's fix the query URL for MacPorts.
2021-07-18 09:22:34 +08:00
Carlo Cabrera
080bd8bd4a
dev-cmd/pr-publish: pass --autosquash by default
It's too easy to forget to, and the consequences of forgetting to pass
`--autosquash` are worse (i.e. almost always permanent) than forgetting
to pass `--no-autosquash` (i.e. just do `pr-publish --no-autosquash`
when your command fails).

See the discussion at Homebrew/homebrew-core#80717.
2021-07-18 05:33:35 +08:00
Rylan Polster
aaaf92b905
update-report: still report homebrew/core changes if they are updated 2021-07-17 12:48:02 -04:00
Rylan Polster
672f6dc3d7
formula: fix latest_version_installed? for HOMEBREW_JSON_CORE 2021-07-16 12:14:15 -04:00
Rylan Polster
a1ecb02736
update-report: don't try to report Homebrew/core if not needed 2021-07-16 11:35:51 -04:00
Eric Knibbe
fba8dd6705
Merge pull request #11713 from EricFromCanada/version-new-suffix
version: check for both cases in suffix
2021-07-16 08:48:04 -04:00
Mike McQuaid
d79cd8bd28
Merge pull request #11726 from hyuraku/installed_dependents-reject_build_formula
installed_dependents: reject build formula
2021-07-16 13:42:03 +01:00
EricFromCanada
5519a0b379
version: check for both cases in suffix 2021-07-16 08:28:15 -04:00
Mike McQuaid
ba8c4ce89f
installed_dependents: tweak comment. 2021-07-16 13:13:12 +01:00
hyuraku
2888d050f7 reject build and test dependency 2021-07-16 21:02:38 +09:00
Rylan Polster
a4e093ded0
Merge pull request #11715 from Rylan12/json-improvements
Improvements to JSON bottle handling
2021-07-16 01:50:59 -04:00
Nanda H Krishna
83821cf4df
Merge pull request #11719 from nandahkrishna/commands
commands: remove `diy`, add `lc` alias for `livecheck`
2021-07-15 23:32:15 +05:30
hyuraku
a61d1a7072 repair CaskDependent#runtime_dependencies 2021-07-15 23:49:41 +09:00