Homebrew入れた

MacBook Air を手に入れたのと,研究室のiMacを再インストールしたので,環境設定をしている.
今まではmacportsを使っていたが,今回はhomebrewにしてみた.
homebrewの良いところは,

  • スクリプトがrubyなので読み書きできる(知識不足で結局読めてないのだけど)
  • ビルドが速い
  • 使用ディスク容量少なめ

のようだ.
インストール先は/usr/local/以下である.

https://github.com/mxcl/homebrew/wiki/installation
に従ってインストールしたところ,

% ls /usr/local 
Library/   README.md  bin/       share/

このようにインストールされたんだけど,
これらのファイル群の所有者がrootじゃなくてユーザだった.
/usr/local/を管理者であるとはいえ,とあるユーザのものにしてしまうのって,どうなんだろうとか思った.
このmacはどうせ自分しか使わないし,実行は他のユーザからもできるので別にいいのだけど,
というか,macportsみたいに毎回sudoする方がヤバいということなんだろうか.ぐぐっても誰も気にしてないようだし.

  • 追記

Homebrew自体のアップデートをする.gitが必要.

$ brew install git
$ brew update

これで,HomebrewとFomulaが最新になるらしい.
port selfupdate と port sync するのと同じ感じか.
参考:http://d.hatena.ne.jp/yonchu/20110226/1298723822

updateするとgitが古くなっていたので,新しいの入れた.

前.gitがoutdatedになっている.

% brew outdated
git (1.7.4.1 < 1.7.4.2)
% git --version
git version 1.7.4.1
% ls /usr/local/Cellar/git
1.7.4.1/
% ls -l `which git`
lrwxr-xr-x  1 user  staff  29  3 31 15:19 /usr/local/bin/git@ -> ../Cellar/git/\
1.7.4.1/bin/git

インストール.contribになんかあるみたい.

% brew install git
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.4.2.tar.bz2
######################################################################## 100.0%
==> make prefix=/usr/local/Cellar/git/1.7.4.2 install
==> Downloading http://kernel.org/pub/software/scm/git/git-manpages-1.7.4.2.tar.bz2
######################################################################## 100.0%
==> Downloading http://kernel.org/pub/software/scm/git/git-htmldocs-1.7.4.2.tar.bz2
######################################################################## 100.0%
==> Caveats
Bash completion and emacs support have been installed.

The rest of the "contrib" folder has been copied to:
  /usr/local/Cellar/git/1.7.4.2/share/contrib
==> Summary
/usr/local/Cellar/git/1.7.4.2: 1051 files, 19M, built in 92 seconds
% ls /usr/local/Cellar/git/1.7.4.2/share/contrib 
README                    continuous/               git-resurrect.sh*         hooks/                    rerere-train.sh*          vim/
blameview/                convert-objects/          git-shell-commands/       p4import/                 stats/                    workdir/
buildsystems/             examples/                 gitview/                  patches/                  svn-fe/
ciabot/                   fast-import/              hg-to-git/                remotes2config.sh*        thunderbird-patch-inline/
% ls /usr/local/Cellar/git 
1.7.4.1/ 1.7.4.2/

後.新しくなった.

% brew outdated
% ls /usr/local/Cellar/git   
1.7.4.1/ 1.7.4.2/
% git --version
git version 1.7.4.2
% ls -l `which git`
lrwxr-xr-x  1 user  staff  29  4  3 04:02 /usr/local/bin/git@ -> ../Cellar/git/1.7.4.2/bin/git
  • 追記

brew zshで補完できるようになった

cd /usr/share/zsh/site-functions
sudo ln -s /usr/local/Library/Contributions/brew_zsh_completion.zsh _brew