93 Commits

Author SHA1 Message Date
Ilya Kulakov
1a6f6f0c5e
Update Library/Homebrew/dev-cmd/extract.rb
Co-authored-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2024-07-06 10:57:51 -07:00
Ilya Kulakov
a1f9f501e2 extract: Fix missing '--git-revision' in the usage banner 2024-07-05 17:27:22 -07:00
Mike McQuaid
0fda9cb85e
Merge pull request #17622 from Kentzo/extract-log-version 2024-07-04 08:26:00 +01:00
Mike McQuaid
3773940382
Merge pull request #17606 from Homebrew/sorbet-strict-devcmd 2024-07-04 08:25:40 +01:00
Ilya Kulakov
0b4839b397 extract: Log formula version
When extracting based on --git-revision the version of the formula is
not known to the user upfront.
2024-07-03 16:41:31 -07:00
Issy Long
9e0a749231
dev-cmd/extract: Can't be typed: strict because of undef usage 2024-07-01 18:40:12 +01:00
Ilya Kulakov
be48b47d91 extract: Add the --git-revision argument
When pinning formula alongside its dependencies it's important to limit
the search scope.
2024-06-28 17:45:35 -07:00
Eric Knibbe
b8dc576647
dev-cmd/extract: trim version to only digits/decimals for class & file names
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-06-20 08:15:36 -04:00
Mike McQuaid
c13700af00
Use repository consistently instead of repo
The documentation linting job doesn't like `repo` so let's fix this
globally rather than naming it differently in documentation and code.
2024-06-10 09:31:53 +01:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Douglas Eichelberger
2f461b1b95 Port Homebrew::DevCmd::Extract 2024-03-21 19:04:30 -07:00
Markus Reiter
3da0f8c4a6
Fix loading casks/formulae from relative paths. 2024-03-01 04:05:15 +01:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Douglas Eichelberger
36f64d6b30 Enable Style/TopLevelMethodDefinition 2024-01-26 11:37:11 -08:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Mike McQuaid
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01:00
Bo Anderson
beaa6c32a0
Fix cases of core taps being unnecessarily installed 2023-07-13 20:33:31 +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
f4c9a96c70 Enable types in dev-cmd 2023-03-14 08:32:03 -07:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Douglas Eichelberger
dead4de3fc Resolve Lint/EmptyBlock todos 2023-01-26 21:18:24 -08:00
Bo Anderson
6632a4fd49
dev-cmd/extract: strip out old bottle disable reasons 2022-06-10 20:25:21 +01:00
fn ⌃ ⌥
8f96ba3c1e extract: remove bottle blocks 2021-11-19 10:45:30 -08:00
Bo Anderson
ce679a8783
dev-cmd/extract: remove old DependencyCollector::Compat handling 2021-09-14 10:17:52 +01:00
Adrian Ho
a14d8924de extract: ignore syntax errors during load 2021-07-20 09:57:04 +08:00
Steve Peters
2655014951
extract: use downcased version in filename
Formula filenames are required to be lowercase, so the
extract command should downcase version before
using it to construct the filename. I noticed this while
extracting tbb@2020, which has version 2020_U3
and resulted in tbb@2020_U3.rb
2021-05-25 23:20:15 -07:00
Bo Anderson
f174d4363f
extend/pathname: limit write override to a refinement 2021-05-04 14:20:20 +01:00
EricFromCanada
571179ff0e pass second argument to ohai when applicable 2021-01-26 15:36:43 -05:00
Rylan Polster
7f23b55c5e
Cleanup command descriptions
Don't have a period within first full sentence of the description
2021-01-25 13:46:35 -05:00
Rylan Polster
f295e36a22
extract: re-add named arg types 2021-01-23 15:10:14 -05:00
Issy Long
49b9b6cf3f
dev-cmd/extract: Improve the usage instructions
- A friend got an error message when trying to use `brew extract` and it
  wasn't immediately obvious to me why. The usage banner only mentioned
  the "formula" argument, which they'd provided. This improves the error
  message when there aren't enough arguments so that others have a
  chance of figuring out how to use this command without having to look
  at the code for `extract_args`.

Before:

```
➜ brew extract --version='1.4' libftdi
Usage: brew extract [--version=] [--force] formula ...
[...]
Error: Invalid usage: this command requires a formula argument
```

After:

```
➜ brew extract --version='1.4' libftdi
Usage: brew extract [options] formula tap
[...]
Error: Invalid usage: This command requires at least 2 named arguments.
```

- I don't like the "at least 2" phrasing here but that's a dive into the
  arg parsing code that I don't have time for right now. An alternative
  was `named_args [:formula, :destination_tap]`, but that gave the error
  message "requires formula or destination_tap" which wasn't great
  either. I also tried `min: 2, max: 2` and that was the same "at least
  2" message.
2021-01-23 20:01:11 +00:00
Rylan Polster
d1f3e39b7b
Update commands to generate usage banner 2021-01-18 21:20:11 -05:00
Rylan Polster
da811373d3 Add named_args DSL for commands 2021-01-13 17:09:42 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
52de3f9d8d extract: fix tap regex 2020-11-10 23:28:31 +11:00
Jonathan Chang
ab7b757400 rubocop: fix Style/NegatedIfElseCondition 2020-11-10 23:28:31 +11:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
3118fedab9 Refactor and document Git. 2020-08-23 06:40:07 +02:00
Bo Anderson
e3372e2a14 Lazily require some heavy files 2020-08-20 02:05:17 +01:00
Markus Reiter
d4c2ffd705 Refactor CLI::Parser. 2020-07-31 15:07:17 +02:00
Markus Reiter
c0d42dd922 Remove --force from global_options. 2020-07-28 10:31:11 +02:00
Mike McQuaid
7596108bd2
Bottle extract and fetch fixes
- Make `brew extract` strip out bottle blocks
- Make `brew extract` output the path in a readable fashion
- Warn about building from source before fetching (not installing)
- If fetching a bottle fails, refetch and build from source.
2020-07-02 11:57:11 +01:00
Caleb Xu
2e6b8d65b3 extract: fix typo 2020-06-18 11:19:04 -04:00
vidusheeamoli
9cfef07682 dev-cmd/extract: instruct users to run git fetch unshallow 2020-04-14 18:07:41 +05:30
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
e3ac94fc5d
dev-cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
Mike McQuaid
2eb908a9fb
dev-cmd/extract: allow maintainers to extract to core.
I was wanting to do this today to add `ruby@2.6` and it's a social
rather than technical requirement (i.e. we don't want users to mess
with their homebrew/core unless they know what they are doing) so allow
overriding with `HOMEBREW_DEVELOPER` set.
2020-02-27 10:36:10 +00:00
Caleb Xu
fa5faf3895 extract: handle versioned formulae names
Turn the output versioned formula from the form "name@version" to
"name-version", then following by appending the specific version
after it.

This solution ensures that separate extracted versions of a formulae
can exist alongside each other (e.g. 'python-2@2.7.17' and
'python-2@2.7.16').
2020-02-23 14:32:13 -05:00