aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/macos.rb
diff options
context:
space:
mode:
authorJack Nagel2013-07-21 20:09:55 -0500
committerJack Nagel2013-07-21 20:09:55 -0500
commit7d16d8c7d665848ebada82fda9c09fc3d1a0daae (patch)
tree3ed0a360986ea6d2bffbb378aaf9ebad7cfbe74c /Library/Homebrew/macos.rb
parent5a4eefe30addb948570eea9a092047ecee483d81 (diff)
downloadhomebrew-7d16d8c7d665848ebada82fda9c09fc3d1a0daae.tar.bz2
Cache pkgutil results at the source
Diffstat (limited to 'Library/Homebrew/macos.rb')
-rw-r--r--Library/Homebrew/macos.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb
index 1359d2b48..b86bc8f42 100644
--- a/Library/Homebrew/macos.rb
+++ b/Library/Homebrew/macos.rb
@@ -234,7 +234,9 @@ module MacOS extend self
end
def pkgutil_info id
- `/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip
+ (@pkginfo ||= {}).fetch(id.to_s) do
+ @pkginfo[id.to_s] = `/usr/sbin/pkgutil --pkg-info "#{id}" 2>/dev/null`.strip
+ end
end
end