From ea6f1fb46beb986bacd439190809e8fa8cfeec74 Mon Sep 17 00:00:00 2001 From: Will Farrington Date: Sat, 11 May 2013 18:39:16 -0700 Subject: [PATCH] Plan a bit for Linux --- lib/puppet/provider/package/homebrew.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/package/homebrew.rb b/lib/puppet/provider/package/homebrew.rb index 385a387..9616f0e 100644 --- a/lib/puppet/provider/package/homebrew.rb +++ b/lib/puppet/provider/package/homebrew.rb @@ -125,11 +125,20 @@ def simplify name end private + def homedir_prefix + case Facter[:osfamily].value + when "Darwin" then "Users" + when "Linux" then "home" + else + raise "unsupported" + end + end + def command_opts @command_opts ||= { :combine => true, :custom_environment => { - "HOME" => "/Users/#{Facter[:boxen_user].value}", + "HOME" => "/#{homedir_prefix}/#{Facter[:boxen_user].value}", "PATH" => "#{self.class.home}/bin:/usr/bin:/usr/sbin:/bin:/sbin", "CFLAGS" => "-O2", "CPPFLAGS" => "-O2",