diff options
| author | Jack Nagel | 2014-07-11 15:29:26 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-07-11 15:41:54 -0500 |
| commit | 677cd519778ab66e19699d847b03a2f3d958bd2a (patch) | |
| tree | 4ed57ad105c23be9eb1b94fb6d057495634b2c7d /Library/Homebrew/os | |
| parent | 72129668f432b9ddb5fa6a53c2573dd9b15e968e (diff) | |
| download | brew-677cd519778ab66e19699d847b03a2f3d958bd2a.tar.bz2 | |
Use Utils.popen_read in XQuartz version codepath
Diffstat (limited to 'Library/Homebrew/os')
| -rw-r--r-- | Library/Homebrew/os/mac.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xquartz.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index 0cff0e64c..5f245b23c 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -231,13 +231,13 @@ module OS def mdfind(*ids) return [] unless OS.mac? (@mdfind ||= {}).fetch(ids) do - @mdfind[ids] = `/usr/bin/mdfind "#{mdfind_query(*ids)}"`.split("\n") + @mdfind[ids] = Utils.popen_read("/usr/bin/mdfind", mdfind_query(*ids), &:read).split("\n") end end def pkgutil_info(id) (@pkginfo ||= {}).fetch(id) do |key| - @pkginfo[key] = `/usr/sbin/pkgutil --pkg-info "#{key}" 2>/dev/null`.strip + @pkginfo[key] = Utils.popen_read("/usr/sbin/pkgutil", "--pkg-info", key, &:read).strip end end diff --git a/Library/Homebrew/os/mac/xquartz.rb b/Library/Homebrew/os/mac/xquartz.rb index cec7bf9e6..eb30bca13 100644 --- a/Library/Homebrew/os/mac/xquartz.rb +++ b/Library/Homebrew/os/mac/xquartz.rb @@ -56,7 +56,9 @@ module OS end def version_from_mdls(path) - version = `mdls -raw -nullMarker "" -name kMDItemVersion "#{path}" 2>/dev/null`.strip + version = Utils.popen_read( + "/usr/bin/mdls", "-raw", "-nullMarker", "", "-name", "kMDItemVersion", path.to_s, &:read + ).strip version unless version.empty? end |
