From a0e1ee69ba47c5224a429cb1c505a31a29b349fc Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Thu, 19 Jul 2012 00:02:39 +0900 Subject: [PATCH] (brew_prefix): New variable; use it instead of "/usr/local". - Add code to detect location of homebrew.mxcl.canna.plist. --- bootstrap.homebrew | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bootstrap.homebrew b/bootstrap.homebrew index ea8d7f8..017215e 100755 --- a/bootstrap.homebrew +++ b/bootstrap.homebrew @@ -9,22 +9,26 @@ brew -v install berkeley-db brew -v install xaw3d brew -v install gettext +brew_prefix=`brew --prefix` + if [ -f /Library/LaunchDaemons/homebrew.mxcl.canna.plist ] then sudo launchctl unload -w /Library/LaunchDaemons/homebrew.mxcl.canna.plist fi -if [ -x /usr/local/sbin/cannakill ] +if [ -x ${brew_prefix}/sbin/cannakill ] then - sudo /usr/local/sbin/cannakill + sudo ${brew_prefix}/sbin/cannakill fi -(cd `brew --prefix` ; git pull https://github.com/chise/homebrew/) +(cd ${brew_prefix}; git pull https://github.com/chise/homebrew/) brew -v install canna brew upgrade sudo sh -c "sed 's/rc\.canna/rc.canna-root/' \ - < /usr/local/Cellar/canna/3.7p3_1/homebrew.mxcl.canna.plist \ + < ${brew_prefix}`ls -l ${brew_prefix}/sbin/cannaserver \ + | sed 's/^.*-> ..//' \ + | sed 's|/sbin/cannaserver||'`/homebrew.mxcl.canna.plist \ > /Library/LaunchDaemons/homebrew.mxcl.canna.plist" sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.canna.plist -- 1.7.10.4