Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Upgrade Hombrew and Use brew definition directly
Browse files Browse the repository at this point in the history
* Remove brew_install completely
* Latest homebrew was needed to get solr,svn & zsh recipes to work
  • Loading branch information
hiremaga committed Mar 4, 2013
1 parent 22678bd commit bad1683
Show file tree
Hide file tree
Showing 42 changed files with 57 additions and 108 deletions.
2 changes: 1 addition & 1 deletion attributes/versions.rb
@@ -1,5 +1,5 @@
node.default['versions']= {
"homebrew" => "afa5150fabd2fb5247e32bcef7ed561635191143",
"homebrew" => "57ae9c7ace04fb1b54bd1d863fd3f701afc62f46",
"bash_it" => "5cb0ecc1c813bc5619e0f708b8015a4596a37d6c",
"rvm" => "88ca5e086e01e9e29bdeb494cb6a3ccda4c7e256"
}
19 changes: 0 additions & 19 deletions libraries/brew.rb
@@ -1,11 +1,4 @@
class Chef::Recipe
def brew_install(package, opts={})
brew package do
action :install
options opts[:brew_args]
end
end

def brew_installed?(package)
include_recipe "pivotal_workstation::homebrew"
installed=(system("brew list #{package} > /dev/null 2>&1") || brew_has_multiple_versions_installed?(package))
Expand All @@ -18,16 +11,4 @@ def brew_has_multiple_versions_installed?(package)
Chef::Log.debug("brew package #{package} " + (multiple ? "HAS" : "does NOT HAVE") + " multiple versions.")
multiple
end

def brew_remove(package)
brew package do
action :remove
end
end

def brew_update
brew do
action :update
end
end
end
2 changes: 1 addition & 1 deletion recipes/ack.rb
@@ -1 +1 @@
brew_install "ack"
brew "ack"
2 changes: 1 addition & 1 deletion recipes/activemq.rb
@@ -1 +1 @@
brew_install("activemq")
brew "activemq"
3 changes: 1 addition & 2 deletions recipes/bash4.rb
@@ -1,6 +1,5 @@
if node["platform"] != "mac_os_x"
package "bash"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "bash"
brew "bash"
end
3 changes: 1 addition & 2 deletions recipes/bash_completion.rb
Expand Up @@ -2,6 +2,5 @@
if node["platform"] != "mac_os_x"
package "bash-completion"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "bash-completion"
brew "bash-completion"
end
3 changes: 1 addition & 2 deletions recipes/coreutils.rb
@@ -1,6 +1,5 @@
if node["platform"] != "mac_os_x"
package "coreutils"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "coreutils"
brew "coreutils"
end
4 changes: 1 addition & 3 deletions recipes/csshx.rb
@@ -1,3 +1 @@
include_recipe "pivotal_workstation::homebrew"

brew_install "csshx"
brew "csshx"
2 changes: 1 addition & 1 deletion recipes/ec2_api_tools.rb
@@ -1,3 +1,3 @@
brew_install "ec2-api-tools"
brew "ec2-api-tools"

pivotal_workstation_bash_it_custom_plugin "ec2_tools-export_paths_and_credentials.bash"
2 changes: 1 addition & 1 deletion recipes/erlang.rb
@@ -1 +1 @@
brew_install "erlang"
brew "erlang"
3 changes: 1 addition & 2 deletions recipes/findutils.rb
@@ -1,6 +1,5 @@
if node["platform"] != "mac_os_x"
package "findutils"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "findutils"
brew "findutils"
end
4 changes: 1 addition & 3 deletions recipes/git.rb
@@ -1,7 +1,5 @@
include_recipe "pivotal_workstation::homebrew"

if node["platform"] != "mac_os_x"
package "git"
else
brew_install "git"
brew "git"
end
3 changes: 1 addition & 2 deletions recipes/gnu-tar.rb
@@ -1,6 +1,5 @@
if node["platform"] == "mac_os_x"
include_recipe "pivotal_workstation::homebrew"
brew_install "gnu-tar"
brew "gnu-tar"
link "/usr/bin/tar" do
to "/usr/local/bin/gtar"
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/heroku_toolbelt.rb
@@ -1 +1 @@
brew_install "heroku-toolbelt"
brew "heroku-toolbelt"
2 changes: 1 addition & 1 deletion recipes/hub.rb
@@ -1,4 +1,4 @@
brew_install "hub"
brew "hub"

# homebrew recipe for hub automatically installs the following as well:
# Bash completion has been installed to:
Expand Down
4 changes: 1 addition & 3 deletions recipes/imagemagick.rb
@@ -1,3 +1 @@
include_recipe "pivotal_workstation::homebrew"

brew_install "imagemagick"
brew "imagemagick"
4 changes: 1 addition & 3 deletions recipes/joe.rb
@@ -1,3 +1 @@
include_recipe "pivotal_workstation::homebrew"

brew_install "joe"
brew "joe"
3 changes: 1 addition & 2 deletions recipes/jpegoptim.rb
@@ -1,4 +1,3 @@
if node["platform"] == "mac_os_x"
include_recipe "pivotal_workstation::homebrew"
brew_install "jpegoptim"
brew "jpegoptim"
end
4 changes: 1 addition & 3 deletions recipes/memcached.rb
@@ -1,7 +1,5 @@
include_recipe "pivotal_workstation::homebrew"

unless brew_installed? "memcached"
brew_install "memcached"
brew "memcached"

directory "/Users/#{WS_USER}/Library/LaunchAgents" do
owner WS_USER
Expand Down
4 changes: 1 addition & 3 deletions recipes/mongodb.rb
@@ -1,7 +1,5 @@
include_recipe "pivotal_workstation::homebrew"

unless brew_installed? "mongodb"
brew_install "mongodb"
brew "mongodb"

directory "/Users/#{WS_USER}/Library/LaunchAgents" do
owner WS_USER
Expand Down
2 changes: 1 addition & 1 deletion recipes/mysql.rb
Expand Up @@ -17,7 +17,7 @@
end
end

brew_install("mysql")
brew "mysql"

ruby_block "copy mysql plist to ~/Library/LaunchAgents" do
block do
Expand Down
2 changes: 1 addition & 1 deletion recipes/nginx.rb
Expand Up @@ -8,7 +8,7 @@
command "sudo brew remove nginx"
end

brew_install "nginx"
brew "nginx"

plist_path = File.expand_path('org.nginx.nginx.plist', File.join('~', 'Library', 'LaunchAgents'))
if File.exists?(plist_path)
Expand Down
2 changes: 1 addition & 1 deletion recipes/node_js.rb
@@ -1 +1 @@
brew_install "node"
brew "node"
3 changes: 1 addition & 2 deletions recipes/optipng.rb
@@ -1,4 +1,3 @@
if node["platform"] == "mac_os_x"
include_recipe "pivotal_workstation::homebrew"
brew_install "optipng"
brew "optipng"
end
22 changes: 11 additions & 11 deletions recipes/php54.rb
Expand Up @@ -10,15 +10,15 @@
not_if { system("brew tap | grep 'dupes' > /dev/null 2>&1") }
end

brew_install "php54", {:brew_args => "--with-mysql --with-pgsql"}
brew "php54", {:brew_args => "--with-mysql --with-pgsql"}

brew_install "php54-apc"
brew_install "php54-memcached"
brew_install "php54-inclued"
brew_install "php54-http"
brew_install "php54-xdebug"
brew_install "php54-intl"
brew_install "php54-yaml"
brew_install "php54-imagick"
brew_install "php54-solr"
brew_install "php54-twig"
brew "php54-apc"
brew "php54-memcached"
brew "php54-inclued"
brew "php54-http"
brew "php54-xdebug"
brew "php54-intl"
brew "php54-yaml"
brew "php54-imagick"
brew "php54-solr"
brew "php54-twig"
4 changes: 2 additions & 2 deletions recipes/postgres.rb
Expand Up @@ -22,7 +22,7 @@
recursive true
end

brew_install "postgresql"
brew "postgresql"

execute "create the database" do
command "/usr/local/bin/initdb -U postgres --encoding=utf8 --locale=en_US /usr/local/var/postgres"
Expand Down Expand Up @@ -71,7 +71,7 @@
end

ruby_block "test to see if postgres is running" do
block do
block do
require 'socket'
postgres_port = 5432
begin
Expand Down
3 changes: 1 addition & 2 deletions recipes/pwgen.rb
@@ -1,6 +1,5 @@
if node["platform"] != "mac_os_x"
package "pwgen"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "pwgen"
brew "pwgen"
end
3 changes: 1 addition & 2 deletions recipes/qt.rb
@@ -1,4 +1,3 @@
include_recipe "pivotal_workstation::homebrew"
include_recipe "pivotal_workstation::xquartz"

brew_install "qt"
brew "qt"
2 changes: 1 addition & 1 deletion recipes/rabbitmq.rb
@@ -1 +1 @@
brew_install "rabbitmq"
brew "rabbitmq"
4 changes: 2 additions & 2 deletions recipes/rbenv.rb
Expand Up @@ -3,8 +3,8 @@
::RBENV_HOME = "#{WS_HOME}/.rbenv"
::RBENV_COMMAND = "/usr/local/bin/rbenv"

brew_install("rbenv")
brew_install("ruby-build")
brew "rbenv"
brew "ruby-build"

pivotal_workstation_bash_it_enable_feature "plugins/rbenv"

Expand Down
2 changes: 1 addition & 1 deletion recipes/redis.rb
@@ -1,7 +1,7 @@
include_recipe "pivotal_workstation::homebrew"

unless brew_installed? "redis"
brew_install "redis"
brew "redis"

directory "/Users/#{WS_USER}/Library/LaunchAgents" do
owner WS_USER
Expand Down
4 changes: 1 addition & 3 deletions recipes/selenium_webdriver.rb
@@ -1,3 +1 @@
include_recipe "pivotal_workstation::homebrew"

brew_install "chromedriver"
brew "chromedriver"
3 changes: 1 addition & 2 deletions recipes/siege.rb
@@ -1,6 +1,5 @@
if node["platform"] != "mac_os_x"
package "siege"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "siege"
brew "siege"
end
2 changes: 1 addition & 1 deletion recipes/solr.rb
@@ -1 +1 @@
brew_install "solr"
brew "solr"
4 changes: 1 addition & 3 deletions recipes/ssh_copy_id.rb
@@ -1,3 +1 @@
include_recipe "pivotal_workstation::homebrew"

brew_install "ssh-copy-id"
brew "ssh-copy-id"
2 changes: 1 addition & 1 deletion recipes/svn.rb
@@ -1 +1 @@
brew_install "svn"
brew "svn"
4 changes: 1 addition & 3 deletions recipes/tmux.rb
@@ -1,9 +1,7 @@
include_recipe "pivotal_workstation::homebrew"
include_recipe "pivotal_workstation::git"
brew_install "tmux"
brew "tmux"

remote_file "#{WS_HOME}/.tmux.conf" do
source node["tmux_conf_file_url"]
mode "0644"
end

11 changes: 5 additions & 6 deletions recipes/unix_essentials.rb
@@ -1,10 +1,9 @@
include_recipe "pivotal_workstation::homebrew"
include_recipe "pivotal_workstation::ack"
include_recipe "pivotal_workstation::tmux"
include_recipe "pivotal_workstation::xquartz"

brew_install "watch"
brew_install "ssh-copy-id"
brew_install "pstree"
brew_install "tree"
brew_install "wget"
brew "watch"
brew "ssh-copy-id"
brew "pstree"
brew "tree"
brew "wget"
3 changes: 1 addition & 2 deletions recipes/watch.rb
@@ -1,4 +1,3 @@
if node["platform"] == "mac_os_x"
include_recipe "pivotal_workstation::homebrew"
brew_install "watch"
brew "watch"
end
3 changes: 1 addition & 2 deletions recipes/wget.rb
@@ -1,6 +1,5 @@
if node["platform"] != "mac_os_x"
package "wget"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "wget"
brew "wget"
end
3 changes: 1 addition & 2 deletions recipes/xmlstarlet.rb
@@ -1,8 +1,7 @@
if node["platform"] != "mac_os_x"
package "xmlstarlet"
else
include_recipe "pivotal_workstation::homebrew"
brew_install "xmlstarlet"
brew "xmlstarlet"
link "/usr/local/bin/xmlstarlet" do
to "/usr/local/bin/xml"
end
Expand Down
2 changes: 1 addition & 1 deletion recipes/zsh.rb
@@ -1 +1 @@
brew_install "zsh"
brew "zsh"

0 comments on commit bad1683

Please sign in to comment.