Skip to content

Commit

Permalink
Add command to export homebrew installed formulas
Browse files Browse the repository at this point in the history
This culls the dependent packages from the installed list, leaving only
the top-level installs.
  • Loading branch information
jwhitley committed Oct 31, 2013
1 parent c01bd71 commit c2e10f9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions local/mac/bin/brew-export
@@ -0,0 +1,22 @@
#!/bin/zsh

set -e

tmpdir=`mktemp -d "$HOME/tmp/${0:t}.XXXXXXXXXXX"`
deps=$tmpdir/brew.deps
formulas=$tmpdir/brew.formulas
dependents=$tmpdir/brew.dependents
install_set=$tmpdir/brew.install_set

brew deps -n --installed > $deps

# Extract the list of formulas
brew list > $formulas

# Extract the dependents
cut -d: -f 2 $deps | sed -e 's/^ //' -e '/^$/d' -e 's/ /\
/g' | sort -u > $dependents

cat $formulas $dependents | sort | uniq -u

rm -rf $tmpdir

0 comments on commit c2e10f9

Please sign in to comment.