Commit Graph
56 Commits
Author SHA1 Message Date
Harald Nordgren 225514741d Add quiet mode for automatic updates 2026-08-06 14:07:03 +02:00
Harald Nordgren 29cd62f216 Clarify install output for durations and single deps
Show the top-level formula header whenever any dependency was
installed first, not only when there were two or more, so the
transition from a dependency build to the formula build is clear.

Also format long build durations as hours and minutes and drop the
seconds once past five minutes, showing at most two units.
2026-07-06 13:12:05 +02:00
Harald Nordgren 0391258cc9 info: bold dependencies of uninstalled formulae
`brew info <formula>` marked installed dependencies with a green ✔ but
left uninstalled ones (e.g. `llvm`) as plain text, so they were easy to
miss among the ticks.

Give `pretty_install_status` a nilable `bold:` flag:

- `true`  bold every entry, installed or not
- `false` never bold any entry
- `nil`   (default) bold installed entries only

`brew info`'s header and its dependency/requirement listings pass
`bold: true`, so the formula name and all of its deps render bold whether
or not they are installed. A dependency's red ✘ still only appears when
the formula itself is installed and the dependency is missing. Add a
`pretty_unmarked` helper for the bold-but-unmarked case.
2026-07-05 20:17:24 +02:00
Harald Nordgren 2b741705ef Split and columnize dry-run dependency listings
Group `brew upgrade --dry-run` dependencies into separate "Would install"
and "Would upgrade" sections aligned with format_upgrade_summary, and read
the installed version from the kegs so unlinked upgrades still show
"old -> new".

Also stop the first dependency in the "Installing dependencies for" line
from rendering bolder than the rest.
2026-07-05 12:15:59 +02:00
Harald Nordgren c8093dbf6c info: title installed section "Installed Versions" when not verbose
The default view lists a single version line per formula, so the
"Installed Versions" title fits it better. Keep the existing
"Installed Kegs and Versions" title for --verbose, which lists each
individual keg with its tab details.
2026-06-28 23:28:18 +02:00
Harald Nordgren 98c3103e04 formula_installed_prefixes: dedupe symlinked alias racks
When a formula's possible names include both a rack and a symlink to
that same rack (e.g. Cellar/python3 -> Cellar/python via the python3
alias), every keg under it was discovered once per name, so brew info
listed each installed version twice. Dedupe the Cellar directories by
their resolved physical path before collecting subdirs.
2026-06-28 23:19:50 +02:00
Harald Nordgren f7941376b1 info: hide older non-linked kegs unless verbose
Only show the newest keg of each formula plus any linked keg in the
"Installed Kegs and Versions" section by default. Older, non-linked
kegs are listed only with --verbose.
2026-06-28 23:19:50 +02:00
Harald Nordgren 15648fe83e Warn about missing libraries in brew info
When a dependency's soname bumps and the old dylib is removed, an
installed formula's binaries can be left linking against a library
that no longer exists, aborting at load time with a dyld error.

Surface this in the `brew info` Dependencies section for installed
formulae as a "Missing libraries" line, marking each library with a
red ✘ like other dependency statuses. The fix suggestion is
`brew upgrade` when the formula is outdated (which also relinks it)
and `brew reinstall` otherwise. The libraries are read from the
existing LinkageChecker, combining broken dependencies (dylibs under
opt/<dep>/) and broken dylibs that map to no dependency.
2026-06-23 13:30:56 +02:00
Harald Nordgren ec61b24045 Revert "Merge pull request #22767 from HaraldNordgren/simplify-pretty-install-status-outdated" 2026-06-18 10:28:11 +02:00
Harald Nordgren 05167c9078 Drop redundant installed guard from pretty_install_status callers
`pretty_install_status` already gates the upgradable status on
`installed && outdated`, so callers passing
`outdated: installed && formula.outdated?` duplicated the guard.
Pass `outdated: formula.outdated?` directly and let the method
combine it with `installed`.
2026-06-17 09:59:35 +02:00
Harald Nordgren 5ae846fe2e Don't bold upgradable dependencies in install plans
The install dependency list is already a plain "would install" list,
so bolding the upgradable entries made them stand out inconsistently
from the fresh installs. Add a `bold:` option to `pretty_upgradable`
and `pretty_install_status` (defaulting to `true` to preserve `brew
info` styling) and pass `bold: false` from the install plans.
2026-06-16 23:57:40 +02:00
Harald Nordgren 191b5834a3 Annotate upgradable dependencies in install plans
Show installed-but-outdated dependencies with the upgradable status
already used by `brew info`, so the install dependency list signals
an upgrade rather than looking like a fresh install.
2026-06-16 17:57:00 +02:00
Harald Nordgren f6b4c149ea Handle formulae and casks more uniformly across commands
Several commands carried parallel formula/cask branches doing the same
thing through different method names. Add shared methods and route the
duplicated logic through them:

- reloadable_ref on Formula and Cask returns the ref re-fed to
  Formulary.factory / Cask::CaskLoader.load when reloading for another
  os/arch, replacing the inline loaded_from_api? check in fetch and
  --cache (now one reload loop).
- Formula#installed? aliases any_version_installed? to match
  Cask#installed?, letting tab and uses drop their type branches.
- Utils::Bottles::Tag.from_arg centralises the --bottle-tag-or-os/arch
  idiom shared by fetch, --cache and verify.
- unpin, missing and home iterate formulae and casks in one loop.
2026-06-08 15:22:19 +02:00
Harald Nordgren a2a0594755 info: show both formulae when same-named args shadow each other
When two taps have a formula with the same name, passing both the
plain name and the tap-qualified name only showed one of them. Both
names point to the same formula, so they were merged into one before
`brew info` could swap the plain name to show the installed
(shadowing) version. Now keep both, do the swap first, then merge only
formulae with the same full name. So the two names show separate
blocks, but repeating the same name still shows one.
2026-06-07 18:30:25 +02:00
Harald Nordgren c0873df8fe info: show a shadowed formula's status and the shadowing keg
When two taps provide a formula of the same name they share one
cellar rack, so only one can be installed at a time. Running
`brew info <tap>/<name>` on the formula that did NOT install the keg
previously showed that keg as this formula's install and `[Linked]`.

Now show such a formula by its full (tap-qualified) name, mark it not
installed, and list the shadowing formula's keg under "Installed Kegs
and Versions" so the actually-installed sibling is still visible.
2026-06-07 18:30:25 +02:00
Harald Nordgren 4244e04bd0 info: resolve conflicts and drop stale self-conflicts
Resolve each conflict to its actual formula and show the resolved
full name, so a conflict that points to a formula in another tap is
unambiguous rather than a bare name. When a conflict resolves to the
formula itself (e.g. hashicorp/tap/terraform's `conflicts_with
"terraform"` after terraform left homebrew-core), omit it instead of
printing a confusing self-conflict.
2026-06-07 18:30:25 +02:00
Harald Nordgren 461e6cd169 info, tap-info: skip uninstalled marker when not a problem
The red ✘ uninstalled marker reads as an error, but in some places
uninstalled is the norm rather than a problem:

- tap-info: every uninstalled formula/cask in the tap catalog
- brew info <pkg>: deps and requirements when the package itself is
  not installed (the listing just shows what would be pulled in)

Add a 'mark_uninstalled:' parameter to 'pretty_install_status' that,
when false, returns the plain string instead of the red ✘. Pass it
through 'decorate_dependencies'/'decorate_requirements' in both
'cmd/info' and 'cask/info', and use it unconditionally in 'tap-info'.

Keep the marker where missing really signals a problem: info headers,
deps/requirements of an installed package, and update reports for
removed entries.
2026-05-19 00:26:54 +02:00
Harald Nordgren 782965884e gitignore: ignore test/.npm/ 2026-05-18 19:27:16 +02:00
Harald Nordgren 3df4930233 info: mark deprecated/disabled formulae and casks in install status
Match the '(deprecated)'/'(disabled)' suffix already shown by
'brew search'. Apply it via 'pretty_install_status' so it shows in the
'brew info' title and 'brew tap-info' formula/cask listings, and
refactor 'brew search' to use the same helper.
2026-05-18 17:08:36 +02:00
Harald Nordgren 5131c0eab1 info: indicate upgrade target for outdated @-versioned formulae 2026-05-17 18:01:22 +02:00
Harald Nordgren fdfa2e067e parse_basename: take final segment for file:// URLs 2026-05-17 14:57:49 +02:00
Harald Nordgren 29876b85b4 help: show originating tap for external commands 2026-05-17 14:54:59 +02:00
Harald Nordgren a2b77dc490 info: add installed versions section 2026-05-16 15:21:10 +02:00
Harald Nordgren c31ed16f41 cli: hide hide_from_man_page commands from brew commands 2026-05-12 08:56:06 +02:00
Harald Nordgren d1f1ce8698 info: resolve aliased deps when checking installed status 2026-05-11 10:16:55 +02:00
Harald Nordgren 52508c8d94 pr fixes 2026-05-10 20:38:24 +02:00
Harald NordgrenandMike McQuaid ae7723002d Update Library/Homebrew/cmd/info.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2026-05-10 20:24:52 +02:00
Harald Nordgren b24eef592f info: resolve installed formulae from receipt's tap and warn on shadow 2026-05-10 20:18:33 +02:00
Harald Nordgren edf0d75713 tap-info: list formulae and casks with install status 2026-05-09 22:08:08 +02:00
Harald Nordgren 855f42efa6 info: unify dep status logic for installed and uninstalled formulae 2026-05-07 21:25:48 +02:00
Harald Nordgren 04e6932653 info: mark deps as outdated when linked keg differs from tab 2026-05-07 20:29:27 +02:00
Harald Nordgren d1212bbd9a info: switch dep check from LinkageChecker to tab runtime_dependencies 2026-05-07 20:29:27 +02:00
Harald Nordgren c059f48e40 info: check installed deps via linkage check on installed keg 2026-05-07 20:29:27 +02:00
Harald Nordgren 931b2e189b info: render verbose dependents inline under Dependencies
Avoid a standalone ohai header for what is logically a sub-section of
Dependencies; render it as a single 'Dependents (N): ...' line, matching
the sibling Required/Recursive Runtime lines.
2026-05-07 11:20:07 +02:00
Harald Nordgren aad9aedef3 info: list installed dependents with --verbose
Render the dependents as a tabular `==> Dependents (N)` section under
`--verbose`, matching the existing `Binaries` block. Non-verbose output
is unchanged.
2026-05-07 11:18:17 +02:00
Harald Nordgren 5db6ca5707 list: make --multiple imply --versions 2026-05-07 08:58:59 +02:00
Harald Nordgren 83f6336684 info: fetch bottle manifest under --verbose
Trigger the bottle manifest fetch under `--verbose` so users don't
need to combine `-v` with `--fetch-manifest`. Mirrors how `-v`
already pulls analytics inline.
2026-05-06 14:59:00 +02:00
Harald Nordgren 3c888296ce info: gate Binaries section on --verbose
Move the `==> Binaries` section behind `--verbose` (`-v`) so the
default `brew info` output stays concise.
2026-05-06 14:40:51 +02:00
Harald Nordgren 5a11cd69a1 info: add Binaries section listing executables
List the formula's bin/ and sbin/ executables in a new `==> Binaries`
section before `==> Caveats`. For installed formulae the list is read
from the linked keg; for not-installed formulae `--fetch-manifest`
triggers a fallback that reads from the bottle manifest, mirroring
how `Bottle Size` and `Installed Size` already behave.
2026-05-06 14:07:37 +02:00
Harald Nordgren 356475e75c caveats: sort shadowed executables alphabetically 2026-05-05 16:17:53 +02:00
Harald Nordgren d73ad55d79 caveats: add HOMEBREW_NO_PATH_SHADOW_CHECK opt-out hint 2026-05-03 22:43:46 +03:00
Harald Nordgren c3c517f980 caveats: still check shadowing for linked keg-only formulae 2026-05-03 21:44:19 +03:00
Harald Nordgren 6980d9ab92 caveats: add HOMEBREW_NO_PATH_SHADOW_CHECK opt-out 2026-05-03 21:44:19 +03:00
Harald Nordgren d61d2a78f7 caveats: warn when formula executables are shadowed on PATH 2026-05-03 21:44:19 +03:00
42e2a5026f Update info.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2026-05-03 15:13:14 +02:00
Harald Nordgren d97838fdd7 info: show installed version and upgrade hint on headline 2026-05-03 13:15:08 +03:00
Harald Nordgren cf85d14e9a info: clarify recursive runtime dependencies line 2026-04-29 14:33:37 +02:00
Harald NordgrenandMike McQuaid 05802c75b3 Update Library/Homebrew/test/cmd/info_spec.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2026-01-12 11:25:47 +01:00
Harald Nordgren 40f500b377 highlight installation status 2026-01-12 11:24:57 +01:00
Harald Nordgren b893e131ea cask: add test for installed dependency status 2025-12-22 16:20:13 +01:00
Harald Nordgren 6db2cd0ac1 pr fixes 2025-12-22 15:43:31 +01:00
Harald Nordgren e0a7804852 pr fixes 2025-12-22 15:43:31 +01:00
Harald Nordgren f46fc8890b Show dependency status for casks (✔/✘) 2025-12-22 15:43:31 +01:00
676bc0e38f Update Library/Homebrew/cask/info.rb
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-08-03 21:20:52 +02:00
Harald Nordgren 7cf5c2cdd9 Show dependencies for casks 2024-08-03 20:25:13 +02:00
Harald Nordgren 5db2ed4fbf brew install: search casks if not found 2018-03-25 19:14:14 +02:00