From b5a5217ba3117dfbfcad63532c2054d83d3249c0 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 30 Dec 2011 23:56:52 -0600 Subject: Add and use plist helper methods These will be used to unify the label namespaces in embedded plists, i.e. 'homebrew.mxcl.'. plist_path returns the full path to a plist file located at the top level of the keg; plist_path.basename can be used if just the filename is needed. c.f. #9346. Signed-off-by: Jack Nagel --- Library/Formula/postgresql.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Library/Formula/postgresql.rb') diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index ce1694209..9f57f2419 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -56,8 +56,8 @@ class Postgresql < Formula system "./configure", *args system "make install-world" - (prefix+'org.postgresql.postgres.plist').write startup_plist - (prefix+'org.postgresql.postgres.plist').chmod 0644 + plist_path.write startup_plist + plist_path.chmod 0644 end def check_python_arch @@ -110,13 +110,13 @@ To migrate existing data from a previous major version (pre-9.1) of PostgreSQL, If this is your first install, automatically load on login with: mkdir -p ~/Library/LaunchAgents - cp #{prefix}/org.postgresql.postgres.plist ~/Library/LaunchAgents/ - launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} -If this is an upgrade and you already have the org.postgresql.postgres.plist loaded: - launchctl unload -w ~/Library/LaunchAgents/org.postgresql.postgres.plist - cp #{prefix}/org.postgresql.postgres.plist ~/Library/LaunchAgents/ - launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist +If this is an upgrade and you already have the #{plist_path} loaded: + launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename} + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} Or start manually with: pg_ctl -D #{var}/postgres -l #{var}/postgres/server.log start @@ -152,7 +152,7 @@ To install gems without sudo, see the Homebrew wiki. KeepAlive Label - org.postgresql.postgres + #{plist_name} ProgramArguments #{HOMEBREW_PREFIX}/bin/postgres -- cgit v1.2.3