Skip to content

Instantly share code, notes, and snippets.

@dolmen
Last active March 30, 2024 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dolmen/ecabdd0a16bc6dbc87b4ef9ca97767c9 to your computer and use it in GitHub Desktop.
Save dolmen/ecabdd0a16bc6dbc87b4ef9ca97767c9 to your computer and use it in GitHub Desktop.
check-xz-in-homebrew
#!/bin/bash
# Commands to evaluate impact of xz installed via homebrew.
# Author: Olivier Mengué.
# Show info about xz bottle:
brew info xz
# Upgrade xz:
brew update
brew upgrade xz
# Show bottles which directly depend on xz (as JSON lines):
brew info --installed --json | jq -c '.[] | select(.dependencies | index("xz")) | {(.name): .dependencies}'
# Show bottles which directly depend on xz (as text):
brew info --installed --json|jq -cr '.[]|select(.dependencies|index("xz"))|(.name + ": " + (.dependencies | join(", ")))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment