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/mysql.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Library/Formula/mysql.rb') diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb index 538a7c1c2..ed7fbb70c 100644 --- a/Library/Formula/mysql.rb +++ b/Library/Formula/mysql.rb @@ -75,8 +75,8 @@ class Mysql < Formula system "make" system "make install" - (prefix+'com.mysql.mysqld.plist').write startup_plist - (prefix+'com.mysql.mysqld.plist').chmod 0644 + plist_path.write startup_plist + plist_path.chmod 0644 # Don't create databases inside of the prefix! # See: https://github.com/mxcl/homebrew/issues/4975 @@ -121,13 +121,13 @@ class Mysql < Formula To launch on startup: * if this is your first install: mkdir -p ~/Library/LaunchAgents - cp #{prefix}/com.mysql.mysqld.plist ~/Library/LaunchAgents/ - launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} - * if this is an upgrade and you already have the com.mysql.mysqld.plist loaded: - launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist - cp #{prefix}/com.mysql.mysqld.plist ~/Library/LaunchAgents/ - launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.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} You may also need to edit the plist to use the correct "UserName". @@ -142,7 +142,7 @@ class Mysql < Formula KeepAlive Label - com.mysql.mysqld + #{plist_name} Program #{HOMEBREW_PREFIX}/bin/mysqld_safe RunAtLoad -- cgit v1.2.3