aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mysql.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2011-04-01 14:24:29 -0700
committerAdam Vandenberg2011-04-01 14:24:29 -0700
commit165dbf7e89a56b14434e64ed28b3fcc54319954a (patch)
tree52adec1e86bfd4f468b152b9dbfcba82353db74c /Library/Formula/mysql.rb
parentc84a7424b4e7034600b07374738c6b237712f78e (diff)
downloadhomebrew-165dbf7e89a56b14434e64ed28b3fcc54319954a.tar.bz2
mysql - remove 'data' from prefix
Remove the 'data' folder from the prefix, so the setup script will not try to create databases there. Putting databases in the prefix instead of directly in /usr/local means they get deleted on a MySQL update, which is not what you want.
Diffstat (limited to 'Library/Formula/mysql.rb')
-rw-r--r--Library/Formula/mysql.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb
index 0d9157b31..1dad913b9 100644
--- a/Library/Formula/mysql.rb
+++ b/Library/Formula/mysql.rb
@@ -18,20 +18,17 @@ class Mysql < Formula
]
end
- def patches
- DATA
- end
+ def patches; DATA; end
def install
- args = [
- ".",
- "-DCMAKE_INSTALL_PREFIX='#{prefix}'",
- "-DMYSQL_DATADIR='#{var}/mysql'",
- "-DINSTALL_MANDIR='#{man}'",
- "-DWITH_SSL=yes",
- "-DDEFAULT_CHARSET='utf8'",
- "-DDEFAULT_COLLATION='utf8_general_ci'",
- "-DSYSCONFDIR='#{HOMEBREW_PREFIX}/etc'"]
+ args = [".",
+ "-DCMAKE_INSTALL_PREFIX=#{prefix}",
+ "-DMYSQL_DATADIR=#{var}/mysql",
+ "-DINSTALL_MANDIR=#{man}",
+ "-DWITH_SSL=yes",
+ "-DDEFAULT_CHARSET=utf8",
+ "-DDEFAULT_COLLATION=utf8_general_ci",
+ "-DSYSCONFDIR=#{etc}"]
# To enable unit testing at build, we need to download the unit testing suite
args << "-DWITH_UNIT_TESTS=OFF" if not ARGV.include? '--with-tests'
@@ -48,6 +45,10 @@ class Mysql < Formula
system "make install"
(prefix+'com.mysql.mysqld.plist').write startup_plist
+
+ # Don't create databases inside of the prefix!
+ # See: https://github.com/mxcl/homebrew/issues/4975
+ rm_rf prefix+'data'
end
def caveats; <<-EOS.undent