Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 1e4e0b8

Browse files
committed
Merge pull request #54 from hanjianwei/fix-cache-dir
Fix cache location
2 parents b5936e1 + f7fc739 commit 1e4e0b8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/puppet/provider/package/homebrew.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ def self.home
2121
end
2222
end
2323

24+
def self.cache
25+
if boxen_home = Facter.value(:boxen_home)
26+
"#{boxen_home}/cache/homebrew"
27+
else
28+
ENV["HOMEBREW_CACHE"] || "/Library/Caches/Homebrew"
29+
end
30+
end
31+
2432
confine :operatingsystem => :darwin
2533

2634
def self.active?(name, version)
@@ -183,7 +191,8 @@ def command_opts
183191
"CPPFLAGS" => "-O2",
184192
"CXXFLAGS" => "-O2",
185193
"BOXEN_S3_HOST" => "#{s3_host}",
186-
"BOXEN_S3_BUCKET" => "#{s3_bucket}"
194+
"BOXEN_S3_BUCKET" => "#{s3_bucket}",
195+
"HOMEBREW_CACHE" => self.class.cache
187196
},
188197
:failonfail => true,
189198
:uid => default_user

0 commit comments

Comments
 (0)