LoginSignup
0

More than 5 years have passed since last update.

HomebrewのFormulaのソースコードを確認する

Last updated at Posted at 2016-12-15

HomebrewのFormulaのコードを読みたい時には以下のコマンドで元のコードをカレントディレクトリに展開できる。

$ brew unpack <パッケージの名前>

実例

$ brew unpack tree
==> Unpacking tree to: /Users/metroid/tmp/tree-1.7.0
==> Downloading http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz
Already downloaded: /Users/metroid/Library/Caches/Homebrew/tree-1.7.0.tgz
==> Verifying tree-1.7.0.tgz checksum
tar xzf /Users/metroid/Library/Caches/Homebrew/tree-1.7.0.tgz

$ ll
total 0
drwxr-xr-x   3 metroid  staff   102B 12 16 00:42 ./
drwxr-xr-x+ 78 metroid  staff   2.6K 12 16 00:42 ../
drwxr-xr-x  19 metroid  admin   646B 12 16 00:42 tree-1.7.0/

helpによると以下のオプションがあるが、

$ brew help unpack
brew unpack [--git|--patch] [--destdir=path] formulae:
    Unpack the source files for formulae into subdirectories of the current
    working directory. If --destdir=path is given, the subdirectories will
    be created in the directory named by path instead.

    If --patch is passed, patches for formulae will be applied to the
    unpacked source.

    If --git is passed, a Git repository will be initialized in the unpacked
    source. This is useful for creating patches for the software.

どちらもpatch作成用のオプションの為、ソースコードを確認する為には特に必要ない。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0