diff options
| author | Mike McQuaid | 2013-11-18 16:19:17 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-11-19 15:21:02 +0000 |
| commit | 63007d6aae27c1016dd4779b011a6698d149b21c (patch) | |
| tree | d7f95eaa6d9b593b591392daf09c19b5ad52a554 /Library/Formula/postgresql.rb | |
| parent | e10c5ac3577902f12ce4f3f38c1a6b9d68574177 (diff) | |
| download | homebrew-63007d6aae27c1016dd4779b011a6698d149b21c.tar.bz2 | |
postgresql: move caveats to commands.
Mirrors the `mysql` formula. Instead of telling people to type commands
actually run them for them instead.
Also, use the shorter, foreground manual run.
Closes #24437.
Diffstat (limited to 'Library/Formula/postgresql.rb')
| -rw-r--r-- | Library/Formula/postgresql.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index 791b87257..8d540ecab 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -68,12 +68,14 @@ class Postgresql < Formula system "make install-world" end + def post_install + unless File.exist? "#{var}/postgres" + system "#{bin}/initdb", "#{var}/postgres", '-E', 'utf8' + end + end + def caveats s = <<-EOS.undent - initdb #{var}/postgres -E utf8 # create a database cluster - postgres -D #{var}/postgres # serve that database - PGDATA=#{var}/postgres postgres # …alternatively - If builds of PostgreSQL 9 are failing and you have version 8.x installed, you may need to remove the previous version first. See: https://github.com/mxcl/homebrew/issues/issue/2510 @@ -94,7 +96,7 @@ class Postgresql < Formula EOS end - plist_options :manual => "pg_ctl -D #{HOMEBREW_PREFIX}/var/postgres -l #{HOMEBREW_PREFIX}/var/postgres/server.log start" + plist_options :manual => "postgres -D #{HOMEBREW_PREFIX}/var/postgres" def plist; <<-EOS.undent <?xml version="1.0" encoding="UTF-8"?> |
