358 Commits

Author SHA1 Message Date
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Markus Reiter
c76170a456
Hide #to_s in docs. 2024-04-26 14:04:55 +02:00
Markus Reiter
fe4ef62aa9
Hide #inspect in docs. 2024-04-26 13:20:05 +02:00
Mike McQuaid
4c0a1c7a02
keg: remove unused python methods. 2024-04-15 08:35:32 +01:00
Michael Cho
060fb92527
keg: comment to odeprecated some Python 2 related methods
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-14 19:58:16 -04:00
Michael Cho
514059da4b
keg: mkpath on main postgresql@X directories
Fix logic in #16966 as it only matched subdirectories

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-11 10:26:28 -04:00
apainintheneck
db507be41a keg: update sorting by version logic
This updates logic to add a `#scheme_and_version` method to be used
with `.sort_by` and `.max_by`. Using `Keg#version` by itself can be
inaccurate when different version schemes are present. This also
updates the behavior of `Formula#eligible_kegs_for_cleanup` to match
the previous behavior. We were dropping the wrong keg based on the
sort being reversed in a previous PR.
2024-03-31 17:52:32 -07:00
Bo Anderson
dd382487c7
Sort kegs based on version scheme 2024-03-29 23:33:41 +00:00
Michael Cho
babb352aef
keg: mkpath while linking {include,lib,share}/postgresql@X
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-28 17:26:58 -04:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Markus Reiter
3472362ddd
Don't stub all Pathnames in tests. 2024-02-13 18:46:58 +01:00
Jason Karns
79a8279b2c
Improve user ergonomics of brew link --overwrite help
When a Keg is unlinked, brew-link gives a helpful message for how to proceed: adding the `--overwrite` flag.

For safety, it also recommends running in `--dry-run` mode first to see what would be deleted.

So a user's common flow would be:

1. run `brew link foo`
2. get error message with guidance
3. run `brew link --overwrite --dry-run foo`
4. inspect
5. run `brew link --overwrite foo`

In this flow, steps 3-5 are likely very common. Common enough that a user may use their shell history to re-populate their prompt with step 3's command, delete the `--dry-run` flag, and re-run. (The end goal, of course, is to link `foo`.)

The `--dry-run` flag needs to be removed from the command, of course. If it had been at the _end_ of the command, it would make the subsequent  modification easier.

Instead of "up arrow, left-arrow a bunch, then backspace over --dry-run, hopefully not backspacing over the formula name", it would be easier for the user if the dry-run flag were already at the end of the command. Then the user can "up arrow, backspace a few times and hit enter".

What's more, if the last arg were `--dry-run`, a more advanced bash user could even use `!:-` to re-run the link command with all-but-the-last-arg.
2024-02-12 09:29:21 -05:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Bo Anderson
a696bd8203
Support multiple oldnames for formulae 2023-04-27 05:15:43 +01:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
adfd12cfd0 Enable more typing 2023-03-21 21:42:51 -07:00
Douglas Eichelberger
1943132cf6 Move i18n out of global 2023-03-11 17:27:53 -08:00
hyuraku
3f553a8ead add linux's binary_executable_or_library_files to keg 2023-01-26 21:41:45 +09:00
Mike McQuaid
4a0e16fbd9
dev-cmd/bottle: use gnu-tar's --mtime.
This allows us to remove all the manual timestamp fiddling and lets
`gnu-tar` handle it for us instead (as-per the most recent
recommendations on https://reproducible-builds.org/docs/archives/).
2022-12-12 16:47:56 +00:00
Lukas Oberhuber
e46a61e181 rename & inline dsymutil to prepare_debug_symbols 2022-07-30 11:08:52 +01:00
Lukas Oberhuber
f4cb9a40a6
remove macos specific dummy call
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2022-07-26 11:26:03 +01:00
Lukas Oberhuber
e1ea9da507 Conceptual draft of dsym support for macos 2022-07-26 00:00:45 +01:00
Carlo Cabrera
0780d06015
keg: create subdirectories of lib/lua instead of symlinks
Some formulae (e.g. `luv`) have a `lib/lua/5.1` subdirectory inside
their keg. Before this change, the `5.1` subdirectory is symlinked into
`HOMEBREW_PREFIX`.

This can result in `luarocks` installing things into a formula's keg,
which we don't want.

Let's fix that by making sure that `brew link` creates these
subdirectories instead of symlinking them. We already do this for
subdirectories of `share/lua`:

8dd96ae8ba/Library/Homebrew/keg.rb (L430)
2022-07-11 10:10:38 +08:00
danielnachun
3b089ee901
keg.rb: add generic codesign_patched_binary method 2022-04-08 18:09:18 -07:00
Bo Anderson
ebda92f908
Revert "Binary patching of build prefixes " 2022-03-21 18:22:36 +00:00
danielnachun
35f426e3e2
keg.rb: add generic codesign_patched_binary method 2022-03-12 17:46:09 -08:00
Carlo Cabrera
10edae9b94
Merge pull request #11644 from carlocab/cpuid-check
formula_cellar_checks: check for `cpuid` instruction when needed
2021-07-06 06:29:27 -07:00
Carlo Cabrera
c59a42b24e
formula_cellar_checks: check for cpuid instruction when needed
This implements the second audit discussed in #11608.
2021-07-04 00:31:31 +01:00
Carlo Cabrera
d88576a89b
keg, cmd/--prefix: handle python3.10 2021-07-03 23:33:09 +01:00
nandahkrishna
f7f9433443
Keg.find_some_installed_dependents: move to installed_dependents.rb 2021-02-12 01:42:17 +05:30
nandahkrishna
56ebffff7a
Refactor code to find dependents of kegs 2021-02-10 11:41:48 +05:30
nandahkrishna
7965ad6160
cmd/uninstall: check for dependent casks 2021-02-09 08:47:11 +05:30
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
Mike McQuaid
15761a283d
cleanup: raise failures and handle later.
These are already handled and outputted as a group in `cmd/cleanup.rb`.

Fixes https://github.com/Homebrew/brew/issues/10379
2021-01-21 13:03:52 +00:00
hyuraku
beccc857e1 cmd/keg: refactor to use keyword arguments 2021-01-15 20:15:40 +09:00
Mike McQuaid
1857dfcd2e
keg: check that alias path exists before checking realpath.
Otherwise this can be a broken symlink which will raise an exception:
https://github.com/Homebrew/homebrew-core/runs/1704569542?check_suite_focus=true#step:6:47
2021-01-15 08:58:06 +00:00
Mike McQuaid
128aeba3a4
Keg: fix alias and versioned symlink handling.
Previously, `brew upgrade gcc@10` could get overzealous and remove the
`LinkedKeg` record for `gcc@9`. This is bad because we then think
`gcc@9` is unlinked when it is not and it causes a tonne of conflicts
when trying to link `gcc@9` again.

Instead, fix up the alias and versioned alias cleanup to be more
precise and only delete the symlinks that point to the current `rack`,
`opt_record` or `linked_keg_record` and unify the logic so it's
performed consistently.

While we're here:
- don't `remove_old_aliases` every time we try to unlink a directory
  but just perform it once per `unlink` operation
- remove the linked keg record on `uninstall`
2021-01-14 16:02:06 +00:00
Mike McQuaid
17a073b6cc
Revert "Keg: allow overwriting same-formula conflicts" 2021-01-14 12:04:59 +00:00
Misty De Meo
a2e0da89e4 Keg: only instantiate Keg.for if target exists 2021-01-13 12:18:49 -08:00
Mike McQuaid
66f0a35587 keg: remove trailing whitespace. 2021-01-13 12:18:49 -08:00
Mike McQuaid
e01fa7d2ae keg: tweak retry comment. 2021-01-13 12:18:49 -08:00
Misty De Meo
53fe6b518f Keg: allow overwriting same-formula conflicts
This is weird. We're seeing some installs where formulae
have no opt prefix and no linked keg record, *but* still
ended up linked into the prefix. Upgrades will blow up in
this case because the old symlinks won't get deleted and
Homebrew will report a nonsensical error message about
not being able to link over another link from the same
formula!

Since the optpath is either missing or pointing to the
wrong destination at this point, the checks for conflict
linking above will have failed. We should instead be safe
to simply blow away these conflicting symlinks and replace
them with the new targets.

Fixes https://github.com/Homebrew/homebrew-core/issues/68866.
2021-01-13 12:18:49 -08:00
Mike McQuaid
7c56fa9caf
linkage: correctly detect missing kegs.
- manually `raise Errno::ENOENT` to ensure that a keg that doesn't exist
  isn't flagged as a system dependency.
- remove the inconsistent and incorrect summary messaging.
2020-11-27 13:12:09 +00:00
Markus Reiter
1b732ec7b2 Fix RuboCop offenses. 2020-11-16 02:05:29 +01:00
Rylan Polster
50890ebd51 fix Lint/DuplicateBranch style 2020-11-16 02:02:52 +01:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00