Skip to content

feat: add Homebrew tap tracking - #235

Merged
ripytide merged 2 commits into
ripytide:mainfrom
Xarianne:brew-tap-tracking
Aug 9, 2026
Merged

feat: add Homebrew tap tracking#235
ripytide merged 2 commits into
ripytide:mainfrom
Xarianne:brew-tap-tracking

Conversation

@Xarianne

@Xarianne Xarianne commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds declarative Homebrew tap management to the brew backend, matching the existing repo support for dnf and flatpak.

Usage

In a group file, declare taps under brew.repos:

brew = {
  repos = [
    "ublue-os/tap",
  ],
  packages = ["aurora-wallpapers"]
}

metapac sync will tap and trust any missing repos. metapac clean will untap and untrust any repos not listed. metapac unmanaged will report taps that are not declared in any group file.

Implementation

  • get_installed_repos() now runs brew tap to discover existing taps.
  • add_repos() runs brew tap <tap> and brew trust --tap <tap>. Trusting is required because recent Homebrew versions refuse to load casks from untrusted taps.
  • remove_repos() runs brew untap <tap> and brew untrust --tap <tap> to keep trust state in sync.

Dependencies

This PR depends on #234 (which you just merged), which fixes metapac clean so packages are removed before repos. Without that fix, brew untap fails because Homebrew refuses to untap a tap that still contains installed casks or formulae:

Error: Refusing to untap ublue-os/tap because it contains the following installed casks:
ublue-os/tap/aurora-wallpapers

Testing

Tested locally with cargo run --:

  1. metapac unmanaged correctly detected a tap not declared in group files.
  2. Added a temporary group file with ublue-os/tap and aurora-wallpapers. metapac sync --no-confirm tapped, trusted, and installed successfully.
  3. Removed the temporary group file. metapac clean --no-confirm uninstalled the package first, then untapped and untrusted the tap.

Checklist

  • cargo check passes
  • cargo fmt passes
  • cargo clippy --all-targets -- -D warnings passes after fix: clean packages before repos #234 is merged
  • README group file example updated
  • Manual end-to-end test completed

@Xarianne
Xarianne force-pushed the brew-tap-tracking branch from bb795f3 to 68dbd6e Compare August 4, 2026 08:04
@ripytide
ripytide force-pushed the brew-tap-tracking branch from 1316b97 to d54b121 Compare August 9, 2026 17:32
@ripytide

ripytide commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Looks good, thanks! I rebased your PR on main so that it could be merged

@ripytide
ripytide marked this pull request as ready for review August 9, 2026 17:35
@ripytide
ripytide merged commit 0182fff into ripytide:main Aug 9, 2026
5 checks passed
@Xarianne

Xarianne commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Awesome :) Thanks for the merge!

@ripytide

ripytide commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Released in v0.10.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants