From a2d6ec482e4715707cd6c1904b0843c129c922d1 Mon Sep 17 00:00:00 2001 From: Jianwei Han Date: Fri, 18 Jul 2014 15:52:44 +0800 Subject: [PATCH] Fix problems for Homebrew in standard location --- Puppetfile | 8 ++--- Puppetfile.lock | 34 ++++------------------ config/boxen.rb | 9 ++++++ hiera/users/hanjianwei.yaml | 1 + manifests/site.pp | 2 +- .../people/manifests/hanjianwei/applications.pp | 5 +++- script/boxen-git-credential | 2 +- script/sync | 2 +- 8 files changed, 24 insertions(+), 39 deletions(-) diff --git a/Puppetfile b/Puppetfile index 9071947..18f8b8d 100644 --- a/Puppetfile +++ b/Puppetfile @@ -29,7 +29,7 @@ end # Includes many of our custom types and providers, as well as global # config. Required. -github "boxen", "3.6.1" +github "boxen", "3.6.3.rc", :repo => "hanjianwei/puppet-boxen" # Support for default hiera data in modules @@ -38,13 +38,10 @@ github "module-data", "0.0.3", :repo => "ripienaar/puppet-module-data" # Core modules for a basic development environment. You can replace # some/most of these if you want, but it's not recommended. -github "dnsmasq", "1.0.1" -github "gcc", "2.0.101" github "git", "2.4.0" github "homebrew", "1.9.5.rc", :repo => "hanjianwei/puppet-homebrew" github "hub", "1.3.0" github "inifile", "1.0.3", :repo => "puppetlabs/puppetlabs-inifile" -github "nginx", "1.4.3" github "nodejs", "3.7.0" github "openssl", "1.0.0" github "pkgconfig", "1.0.0" @@ -57,6 +54,5 @@ github "xquartz", "1.1.1" # Optional/custom modules. There are tons available at # https://github.com/boxen. github "osx", "2.7.0" -github "property_list_key", "0.2.1", :repo => "glarizza/puppet-property_list_key" github "brewcask", "0.0.4.rc2", :repo => "hanjianwei/puppet-brewcask" -github "dotfiles", "0.0.6", :repo => "hanjianwei/puppet-dotfiles" +github "dotfiles", "0.0.9", :repo => "hanjianwei/puppet-dotfiles" diff --git a/Puppetfile.lock b/Puppetfile.lock index 5ab17d9..7df349c 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -1,19 +1,4 @@ GITHUBTARBALL - remote: boxen/puppet-boxen - specs: - boxen (3.6.1) - -GITHUBTARBALL - remote: boxen/puppet-dnsmasq - specs: - dnsmasq (1.0.1) - -GITHUBTARBALL - remote: boxen/puppet-gcc - specs: - gcc (2.0.101) - -GITHUBTARBALL remote: boxen/puppet-git specs: git (2.4.0) @@ -24,11 +9,6 @@ GITHUBTARBALL hub (1.3.0) GITHUBTARBALL - remote: boxen/puppet-nginx - specs: - nginx (1.4.3) - -GITHUBTARBALL remote: boxen/puppet-nodejs specs: nodejs (3.7.0) @@ -69,9 +49,9 @@ GITHUBTARBALL xquartz (1.1.1) GITHUBTARBALL - remote: glarizza/puppet-property_list_key + remote: hanjianwei/puppet-boxen specs: - property_list_key (0.2.1) + boxen (3.6.3.rc) GITHUBTARBALL remote: hanjianwei/puppet-brewcask @@ -81,7 +61,7 @@ GITHUBTARBALL GITHUBTARBALL remote: hanjianwei/puppet-dotfiles specs: - dotfiles (0.0.6) + dotfiles (0.0.9) GITHUBTARBALL remote: hanjianwei/puppet-homebrew @@ -104,22 +84,18 @@ GITHUBTARBALL module-data (0.0.3) DEPENDENCIES - boxen (= 3.6.1) + boxen (= 3.6.3.rc) brewcask (= 0.0.4.rc2) - dnsmasq (= 1.0.1) - dotfiles (= 0.0.6) - gcc (= 2.0.101) + dotfiles (= 0.0.9) git (= 2.4.0) homebrew (= 1.9.5.rc) hub (= 1.3.0) inifile (= 1.0.3) module-data (= 0.0.3) - nginx (= 1.4.3) nodejs (= 3.7.0) openssl (= 1.0.0) osx (= 2.7.0) pkgconfig (= 1.0.0) - property_list_key (= 0.2.1) repository (= 2.3.0) ruby (= 8.0.4) stdlib (= 4.2.1) diff --git a/config/boxen.rb b/config/boxen.rb index 7c33af6..0786876 100644 --- a/config/boxen.rb +++ b/config/boxen.rb @@ -23,3 +23,12 @@ # required for Github Enterprise (defaults to "https://github.com/%s") # ENV['BOXEN_REPO_URL_TEMPLATE'] = 'https://github.yourdomain.com/%s' + +# Setup config for Homebrew +require 'fileutils' + +facts_dir = '/opt/boxen/config/facts' +homebrew_json = '{"use_default_homebrew": true}' + +FileUtils.mkdir_p facts_dir +File.write "#{facts_dir}/homebrew.json", homebrew_json diff --git a/hiera/users/hanjianwei.yaml b/hiera/users/hanjianwei.yaml index f6892e9..aeb15aa 100644 --- a/hiera/users/hanjianwei.yaml +++ b/hiera/users/hanjianwei.yaml @@ -1,2 +1,3 @@ ruby::global::version: "2.1.2" nodejs::global::version: "v0.10" +boxen::config::homebrewdir: "/usr/local" diff --git a/manifests/site.pp b/manifests/site.pp index 036e754..63dac53 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -10,7 +10,7 @@ Exec { "${boxen::config::home}/rbenv/shims", "${boxen::config::home}/rbenv/bin", "${boxen::config::home}/rbenv/plugins/ruby-build/bin", - "${boxen::config::home}/homebrew/bin", + "/usr/local/bin", '/usr/bin', '/bin', '/usr/sbin', diff --git a/modules/people/manifests/hanjianwei/applications.pp b/modules/people/manifests/hanjianwei/applications.pp index c7c00ac..4693d77 100644 --- a/modules/people/manifests/hanjianwei/applications.pp +++ b/modules/people/manifests/hanjianwei/applications.pp @@ -5,10 +5,13 @@ class people::hanjianwei::applications { 'qt5', 'reattach-to-user-namespace', 'tmux', - 'vim', 'wget']: } + package { 'vim': + install_options => ['--override-system-vi'], + } + homebrew::tap { 'homebrew/science': } -> package { 'opencv': } diff --git a/script/boxen-git-credential b/script/boxen-git-credential index 7ec62d4..a7cbc16 100755 --- a/script/boxen-git-credential +++ b/script/boxen-git-credential @@ -40,7 +40,7 @@ else require "open4" fallback = ENV["BOXEN_GIT_CREDENTIAL_FALLBACK"] - fallback ||= "#{config.homedir}/homebrew/bin/git-credential-osxkeychain" + fallback ||= "/usr/local/bin/git-credential-osxkeychain" status = Open4.popen4 fallback, *ARGV do |pid, stdin, stdout, stderr| stdin.write input diff --git a/script/sync b/script/sync index a8b5f42..a8105a8 100755 --- a/script/sync +++ b/script/sync @@ -35,7 +35,7 @@ config = Boxen::Config.load # Sync Homebrew packages. -Dir.chdir "#{config.homedir}/homebrew/Cellar" do +Dir.chdir "/usr/local/Cellar" do Dir["*/*"].each do |dir| name, version = File.split dir -- 1.8.5.3