87 Commits

Author SHA1 Message Date
Nanda H Krishna
a49e7d9483
dev-cmd/livecheck: improve error message when all formulae are autobumped 2025-02-03 12:43:17 +01:00
Mike McQuaid
7ff99e2353
Use ~ instead of ${HOME}
Partial revert of Homebrew/brew#19153
See https://github.com/Homebrew/brew/pull/19153#discussion_r1930678587
2025-01-27 15:19:59 +00:00
Mike McQuaid
bbf5a9f479
env_config: use environment variables consistently
- use e.g. `$HOMEBREW_*` for cases where only the environment variable
  is the entire backtick-quoted string
- use e.g. `${HOMEBREW_*}` for cases where the environment variable is
  part of a backtick-quoted string to make clear what parts are variable
  and what parts are not
- use `export HOMEBREW_*=...` for cases where we're talking about
  setting the environment variable (because it likely needs to be
  exported to work how they want)

Inspired by https://github.com/Homebrew/homebrew-bundle/pull/1579 making
similar changes for Homebrew/homebrew-bundle.
2025-01-27 14:21:27 +00:00
Issy Long
ce562c312b
Alphabetical envvars; better variable names; just the one loop 2025-01-04 14:26:05 +00:00
Issy Long
296c2b9f3f
Be smarter about finding a tap's autobump.txt
- Livecheck blocks can exist in taps other than Core and Cask.
- And packages can have the same name in multiple taps.
2025-01-02 17:41:52 +00:00
Issy Long
a71786a332
Flag and envvar to include autobumped formulae
- This is useful for maintainers to check the full range of livecheck functionality.
2025-01-02 17:20:38 +00:00
Issy Long
4b94bbb4d4
More efficient autobump file reads - and support Casks 2024-12-22 14:40:40 +00:00
Issy Long
b54b9dad2a
Oh the non-breaking space (option + space) got me again 2024-12-22 00:31:56 +00:00
Issy Long
3f976ec0c2
dev-cmd/livecheck: Skip autobumped formulae
- Skip formulae that are autobumped by BrewTestBot,
  to avoid useless effort spent by contributors who
  are checking for formulae to bump and then we close
  their PRs.
2024-12-22 00:27:58 +00:00
Douglas Eichelberger
ce9216e66c Fix use of tap 2024-12-08 10:28:10 -08:00
Issy Long
69cf1df56f
dev-cmd/livecheck: Bump to Sorbet typed: strict 2024-06-30 19:23:26 +01:00
Kevin
c44e053847
Merge pull request #17242 from Homebrew/fix-cask-source-file-path-loading-issues
Fix cask source file path loading issues
2024-05-08 18:28:04 -07:00
Mike McQuaid
222fe8ef0b
Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
2024-05-07 12:18:04 +01:00
apainintheneck
ffc503f1d0 Fix cask source file path loading issues
There are two big changes here. Both have to do with how we want
to load casks in different scenarios. One also is related to formulae.

1. Prevent loading casks & formulae outside of taps for specific commands.

There are certain commands like `bump`, `bump-*-pr`, `livecheck` and `audit`
where it really makes no sense to try and run things if the specified formulae
or cask is not in a tap. A new `#to_formulae_and_casks_with_taps` method was
added to the `CLI::NamedArgs` class to allow us to easily grab and validate
formulae and casks from named arguments.

2. Always load the source file path when loading casks with the path loader.

There was an edge case where all JSON cask files were being loaded without
setting the source file path because most of the work was handed off to the
API loader where that normally would make more sense. Now we set that when
calling the API loader which solves the problem. This improves the user
experience of people using the `--cache` and `fetch` commands in certain
edge cases. Hopefully it makes the user experience a bit more consistent.

A regression test was added for this point.
2024-05-06 23:34:23 -07:00
Sam Ford
a4134125f2
livecheck: Clarify --extract-plist behavior
From the description of the `--extract-plist` option, it would seem
that the `ExtractPlist` strategy is only enabled when the option is
used. Instead, livecheck automatically enables the strategy if the
command is run on only one cask. This rewords descriptions of the
option to clarify the behavior.
2024-03-31 21:01:40 -04:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
821f2a5ab5 Automagically remove -cmd suffix 2024-03-21 19:55:35 -07:00
Douglas Eichelberger
d15f99514c Port Homebrew::DevCmd::Livecheck 2024-03-21 19:04:31 -07:00
Razvan Azamfirei
4129200b96
livecheck: add --extract-plist switch 2024-03-21 11:50:27 +00:00
apainintheneck
b79778229c Resolve Cask::Cask.all todo
Now it takes the :eval_all parameter that means we can remove
ARGV handling inside Cask::Cask.all.
2023-12-21 21:55:16 -08:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
26ea6b7f9e
Pull in REXML gem as it doesn't ship with Ruby 3 2023-10-27 20:24:10 +01:00
Bo Anderson
3b1c171184
Further split up Gemfile into groups 2023-09-27 17:33:44 +01:00
Eric Knibbe
4662678b3b
cmd+dev-cmd: adjust description line breaks
Use to distinguish additional notes from initial explanation and usage info
2023-09-11 02:29:21 -04:00
hyuraku
adc2a2fea1 remove ARGV from Formula#all 2023-09-02 19:35:22 +09:00
Mike McQuaid
375a7ee8dc
Allow configuring Homebrew with .env files
For a long time people have requested some sort of configuration files
for Homebrew. Now: here's the first version of that.

Similarly to how you can configure Git for a system, a repository or
a user: you can configure Homebrew for a system, a prefix or a user.

The system-wide configuration file is `/etc/homebrew/brew.env`, the
prefix-specific configuration file is
`$HOMEBREW_PREFIX/etc/homebrew/brew.env`
and the user-specific configuration file is `~/.homebrew/brew.env`.

As we need to read these files from Bash in `bin/brew` (so they can)
influence functionality ASAP: they are in a simple format that Bash
can read. It may be that we have more complex array or hash data in
future that's configured through JSON or YAML (most likely JSON as we
use it more) and stored in a `brew.json`/`brew.yaml` file in the same
directory.

As this is relying on `eval` in Bash which is fairly dangerous: we
filter the lines with a regex to ensure we're only permitting setting
`HOMEBREW_*` variables and nothing more.

To give a bit of power to system administrators, the
`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in
`/etc/homebrew/brew.env` to ensure that the system-wide configuration
file is loaded last and overrides any prefix or user settings.

Now that we have an actual location for configuration files, let's also
change the `brew livecheck` watchlist configuration file to be in this
directory and deprecate the existing location. As this is a developer
command and the mitigation is to just move the file: we don't need to
follow the normal deprecation process here.
2023-07-28 17:17:14 +01:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
f3a8241e69 Remove useless T.unsafe wrappers 2023-04-03 17:34:39 -07:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
59c03cb2a6
Add deprecations and disables
Do the usual dance:
- commented `odeprecated` to `odeprecated`
- `odeprecated` to `odisabled`
- `odisabled` removed
2023-02-03 10:48:43 +00:00
Mohammad Zain Abbas
e058da1706 Merge branch 'master' into mohammad 2022-09-14 05:19:50 +02:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01:00
Mohammad Zain Abbas
eb2dcf7ea9
Update livecheck command: Casks don't have resource blocks
Co-authored-by: Nanda H Krishna <me@nandahkrishna.com>
2022-07-31 12:29:20 +05:00
Mohammad Zain Abbas
825707a219 Refactored a bit 2022-07-27 20:54:28 +02:00
Mohammad Zain Abbas
a8c1c0c841 Updated description for resource's option in livecheck command 2022-07-27 18:19:14 +02:00
Mohammad Zain Abbas
32659afdbe Updated livecheck command for resources 2022-07-27 13:53:54 +02:00
Mohammad Zain Abbas
bc687c6358 Added check resources_only 2022-07-24 15:47:15 +02:00
Mohammad Zain Abbas
ebf52091eb Check only formulas with resources 2022-07-24 14:14:10 +02:00
Mohammad Zain Abbas
0ee69e2c63 Refractoring for livecheckable resources 2022-07-21 20:02:15 +02:00
Mohammad Zain Abbas
4aa3cc6c97 Minor 2022-07-18 15:03:05 +02:00
Mohammad Zain Abbas
2d231a3478 More compact way to get livecheckable resources 2022-07-18 14:49:32 +02:00
Mohammad Zain Abbas
f8320c89ed Selected all livecheckable resources 2022-07-18 14:42:43 +02:00
Mohammad Zain Abbas
82057003a7 Selected all formulas with livecheckable resources 2022-07-18 14:36:27 +02:00
Mohammad Zain Abbas
ad1a9b5970 Fetched all formulas with livecheckable resources 2022-07-18 14:07:33 +02:00
Mohammad Zain Abbas
dba5754c9f Filter out resources with livecheck block: Work in progress 2022-07-18 14:03:40 +02:00
Mohammad Zain Abbas
8ef6118ba0 Work in progress: Fetch all resources with livecheck block 2022-07-17 13:02:22 +02:00
Mohammad Zain Abbas
59165ed3ec Get all resources in all formulae 2022-07-17 12:47:20 +02:00