Brew-file
でbrew install時に自動でBrewfileをアップデートする機能がありますが、
その際依存パッケージがある場合にそれを考慮してなかったので
依存パッケージもきちんと登録するようにアップデート。
問題が起こる例
brewコマンドではdepsサブコマンドを使うと
依存しているパッケージを表示できます。
例えばzshは
$ brew deps zsh
gdbm
pcre
もしくはinfoで
Dependenciesの項目にあります。
$ brew info zsh
zsh: stable 5.2 (bottled), HEAD
UNIX shell (command interpreter)
http://www.zsh.org/
/usr/local/Cellar/zsh/5.2 (1,138 files, 8.7M) *
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zsh.rb
==> Dependencies
Required: gdbm ✔, pcre ✘
==> Options
--without-etcdir
Disable the reading of Zsh rc files in /etc
--HEAD
Install HEAD version
==> Caveats
In order to use this build of zsh as your login shell,
it must be added to /etc/shells.
Add the following to your zshrc to access the online help:
unalias run-help
autoload run-help
HELPDIR=/usr/local/share/zsh/help
このzshをインストールするとき、もともとpcreとかが入ってないと、
$ brew install zsh
した場合、pcreも自動でインストールされます。
Brew-fileのbrew-wrapを読み込んでいると、
brew install <package>の際にBrewfileを自動でアップデートします。
(もしくはbrwe file brew install <package>。)
ただ、以前のBrew-fileだとBrewfileにzshだけ追加して
pcreを追加してませんでした。
なので、その後、brew file cleanやbrwe file updateすると、
pcreはBrewfileにないので消されてしまいます。
zshを使おうとすると、
$ zsh
dyld: Library not loaded: /usr/local/opt/pcre/lib/libpcre.1.dylib
Referenced from: /usr/local/bin/zsh
Reason: image not found
Trace/BPT trap: 5
な感じでpcreが無いのでエラーが出ます。
fix
ということでbrew installの際、
depsで依存パッケージを探してBrewfile内に無いときは
追加するようにしました。
v3.10.10以上で治っています。
