| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  | require "hardware" | 
					
						
							| 
									
										
										
										
											2016-04-25 18:01:03 +01:00
										 |  |  | require "development_tools" | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  | require "os/mac/version" | 
					
						
							|  |  |  | require "os/mac/xcode" | 
					
						
							|  |  |  | require "os/mac/xquartz" | 
					
						
							| 
									
										
										
										
											2015-10-16 17:08:11 +08:00
										 |  |  | require "os/mac/pathname" | 
					
						
							| 
									
										
										
										
											2015-12-04 13:58:22 -08:00
										 |  |  | require "os/mac/sdk" | 
					
						
							| 
									
										
										
										
											2016-02-01 14:19:29 -05:00
										 |  |  | require "os/mac/keg" | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | module OS | 
					
						
							|  |  |  |   module Mac | 
					
						
							|  |  |  |     extend self | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ::MacOS = self # compatibility | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-25 17:53:43 +01:00
										 |  |  |     raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     # This can be compared to numerics, strings, or symbols | 
					
						
							|  |  |  |     # using the standard Ruby Comparable methods. | 
					
						
							|  |  |  |     def version | 
					
						
							| 
									
										
										
										
											2015-10-16 16:41:14 +08:00
										 |  |  |       @version ||= Version.new(full_version.to_s[/10\.\d+/]) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # This can be compared to numerics, strings, or symbols | 
					
						
							|  |  |  |     # using the standard Ruby Comparable methods. | 
					
						
							|  |  |  |     def full_version | 
					
						
							| 
									
										
										
										
											2016-04-04 11:46:33 +01:00
										 |  |  |       @full_version ||= Version.new(ENV["HOMEBREW_OSX_VERSION"].chomp) | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-10-23 00:07:12 +02:00
										 |  |  |     def prerelease? | 
					
						
							|  |  |  |       # TODO: bump version when new OS is released | 
					
						
							|  |  |  |       version >= "10.12" | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-09 10:21:25 +00:00
										 |  |  |     def outdated_release? | 
					
						
							|  |  |  |       # TODO: bump version when new OS is released | 
					
						
							|  |  |  |       version < "10.9" | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     def cat | 
					
						
							|  |  |  |       version.to_sym | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-12 14:57:54 -04:00
										 |  |  |     # Locates a (working) copy of install_name_tool, guaranteed to function | 
					
						
							|  |  |  |     # whether the user has developer tools installed or not. | 
					
						
							| 
									
										
										
										
											2015-06-13 20:32:04 -04:00
										 |  |  |     def install_name_tool | 
					
						
							| 
									
										
										
										
											2015-08-22 13:21:13 +08:00
										 |  |  |       if (path = HOMEBREW_PREFIX/"opt/cctools/bin/install_name_tool").executable? | 
					
						
							|  |  |  |         path | 
					
						
							| 
									
										
										
										
											2015-06-13 20:32:04 -04:00
										 |  |  |       else | 
					
						
							| 
									
										
										
										
											2016-04-25 18:01:03 +01:00
										 |  |  |         DevelopmentTools.locate("install_name_tool") | 
					
						
							| 
									
										
										
										
											2015-06-13 20:32:04 -04:00
										 |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-12 14:57:54 -04:00
										 |  |  |     # Locates a (working) copy of otool, guaranteed to function whether the user | 
					
						
							|  |  |  |     # has developer tools installed or not. | 
					
						
							| 
									
										
										
										
											2015-06-13 20:32:04 -04:00
										 |  |  |     def otool | 
					
						
							| 
									
										
										
										
											2015-08-22 13:21:13 +08:00
										 |  |  |       if (path = HOMEBREW_PREFIX/"opt/cctools/bin/otool").executable? | 
					
						
							|  |  |  |         path | 
					
						
							| 
									
										
										
										
											2015-06-13 20:32:04 -04:00
										 |  |  |       else | 
					
						
							| 
									
										
										
										
											2016-04-25 18:01:03 +01:00
										 |  |  |         DevelopmentTools.locate("otool") | 
					
						
							| 
									
										
										
										
											2015-06-13 20:32:04 -04:00
										 |  |  |       end | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-01 18:36:46 -05:00
										 |  |  |     def active_developer_dir | 
					
						
							| 
									
										
										
										
											2014-12-16 15:27:36 -05:00
										 |  |  |       @active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip | 
					
						
							| 
									
										
										
										
											2014-05-01 18:36:46 -05:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-30 05:13:41 -07:00
										 |  |  |     # If a specific SDK is requested | 
					
						
							|  |  |  |     #   a) The requested SDK is returned, if it's installed. | 
					
						
							|  |  |  |     #   b) If the requested SDK is not installed, the newest SDK (if any SDKs | 
					
						
							|  |  |  |     #      are available) is returned. | 
					
						
							|  |  |  |     #   c) If no SDKs are available, nil is returned. | 
					
						
							|  |  |  |     # If no specific SDK is requested | 
					
						
							|  |  |  |     #   a) For Xcode >= 7, the latest SDK is returned even if the latest SDK is | 
					
						
							|  |  |  |     #      named after a newer OS version than the running OS. The | 
					
						
							|  |  |  |     #      MACOSX_DEPLOYMENT_TARGET must be set to the OS for which you're | 
					
						
							|  |  |  |     #      actually building (usually the running OS version). | 
					
						
							| 
									
										
										
										
											2016-05-01 14:55:45 +02:00
										 |  |  |     #      https://github.com/Homebrew/legacy-homebrew/pull/50355 | 
					
						
							| 
									
										
										
										
											2016-03-30 05:13:41 -07:00
										 |  |  |     #      https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/Introduction.html#//apple_ref/doc/uid/TP40004626 | 
					
						
							|  |  |  |     #      Section "About SDKs and Simulator" | 
					
						
							|  |  |  |     #   b) For Xcode < 7, proceed as if the SDK for the running OS version had | 
					
						
							|  |  |  |     #      specifically been requested according to the rules above. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-23 04:34:21 -07:00
										 |  |  |     def sdk(v = nil) | 
					
						
							| 
									
										
										
										
											2015-12-04 13:58:22 -08:00
										 |  |  |       @locator ||= SDKLocator.new | 
					
						
							|  |  |  |       begin | 
					
						
							| 
									
										
										
										
											2016-03-23 04:34:21 -07:00
										 |  |  |         sdk = if v.nil? | 
					
						
							|  |  |  |           Xcode.version.to_i >= 7 ? @locator.latest_sdk : @locator.sdk_for(version) | 
					
						
							|  |  |  |         else | 
					
						
							|  |  |  |           @locator.sdk_for v | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2015-12-04 13:58:22 -08:00
										 |  |  |       rescue SDKLocator::NoSDKError | 
					
						
							| 
									
										
										
										
											2015-12-04 14:40:24 -08:00
										 |  |  |         sdk = @locator.latest_sdk | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |       end | 
					
						
							| 
									
										
										
										
											2016-03-30 04:03:19 -07:00
										 |  |  |       # Only return an SDK older than the OS version if it was specifically requested | 
					
						
							|  |  |  |       sdk if v || (!sdk.nil? && sdk.version >= version) | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-12-04 13:58:22 -08:00
										 |  |  |     # Returns the path to an SDK or nil, following the rules set by #sdk. | 
					
						
							| 
									
										
										
										
											2016-03-23 04:34:21 -07:00
										 |  |  |     def sdk_path(v = nil) | 
					
						
							| 
									
										
										
										
											2015-12-04 13:58:22 -08:00
										 |  |  |       s = sdk(v) | 
					
						
							|  |  |  |       s.path unless s.nil? | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     # See these issues for some history: | 
					
						
							| 
									
										
										
										
											2016-05-01 14:55:45 +02:00
										 |  |  |     # https://github.com/Homebrew/legacy-homebrew/issues/13 | 
					
						
							|  |  |  |     # https://github.com/Homebrew/legacy-homebrew/issues/41 | 
					
						
							|  |  |  |     # https://github.com/Homebrew/legacy-homebrew/issues/48 | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     def macports_or_fink | 
					
						
							|  |  |  |       paths = [] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       # First look in the path because MacPorts is relocatable and Fink | 
					
						
							|  |  |  |       # may become relocatable in the future. | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |       %w[port fink].each do |ponk| | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |         path = which(ponk) | 
					
						
							|  |  |  |         paths << path unless path.nil? | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       # Look in the standard locations, because even if port or fink are | 
					
						
							|  |  |  |       # not in the path they can still break builds if the build scripts | 
					
						
							|  |  |  |       # have these paths baked in. | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |       %w[/sw/bin/fink /opt/local/bin/port].each do |ponk| | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |         path = Pathname.new(ponk) | 
					
						
							|  |  |  |         paths << path if path.exist? | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       # Finally, some users make their MacPorts or Fink directorie | 
					
						
							|  |  |  |       # read-only in order to try out Homebrew, but this doens't work as | 
					
						
							|  |  |  |       # some build scripts error out when trying to read from these now | 
					
						
							|  |  |  |       # unreadable paths. | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |       %w[/sw /opt/local].map { |p| Pathname.new(p) }.each do |path| | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |         paths << path if path.exist? && !path.readable? | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       paths.uniq | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def prefer_64_bit? | 
					
						
							| 
									
										
										
										
											2013-10-28 08:45:36 -07:00
										 |  |  |       if ENV["HOMEBREW_PREFER_64_BIT"] && version == :leopard | 
					
						
							|  |  |  |         Hardware::CPU.is_64_bit? | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         Hardware::CPU.is_64_bit? && version > :leopard | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def preferred_arch | 
					
						
							| 
									
										
										
										
											2013-11-26 20:23:19 -06:00
										 |  |  |       if prefer_64_bit? | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |         Hardware::CPU.arch_64_bit | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         Hardware::CPU.arch_32_bit | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     STANDARD_COMPILERS = { | 
					
						
							| 
									
										
										
										
											2014-04-17 08:25:43 -07:00
										 |  |  |       "2.0"   => { :gcc_40_build => 4061 }, | 
					
						
							| 
									
										
										
										
											2013-10-20 00:41:08 -07:00
										 |  |  |       "2.5"   => { :gcc_40_build => 5370 }, | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |       "3.1.4" => { :gcc_40_build => 5493, :gcc_42_build => 5577 }, | 
					
						
							| 
									
										
										
										
											2016-05-22 09:40:08 +01:00
										 |  |  |       "3.2.6" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :clang => "1.7", :clang_build => 77 }, | 
					
						
							|  |  |  |       "4.0"   => { :gcc_40_build => 5494, :gcc_42_build => 5666, :clang => "2.0", :clang_build => 137 }, | 
					
						
							|  |  |  |       "4.0.1" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :clang => "2.0", :clang_build => 137 }, | 
					
						
							|  |  |  |       "4.0.2" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :clang => "2.0", :clang_build => 137 }, | 
					
						
							|  |  |  |       "4.2"   => { :clang => "3.0", :clang_build => 211 }, | 
					
						
							|  |  |  |       "4.3"   => { :clang => "3.1", :clang_build => 318 }, | 
					
						
							|  |  |  |       "4.3.1" => { :clang => "3.1", :clang_build => 318 }, | 
					
						
							|  |  |  |       "4.3.2" => { :clang => "3.1", :clang_build => 318 }, | 
					
						
							|  |  |  |       "4.3.3" => { :clang => "3.1", :clang_build => 318 }, | 
					
						
							|  |  |  |       "4.4"   => { :clang => "4.0", :clang_build => 421 }, | 
					
						
							|  |  |  |       "4.4.1" => { :clang => "4.0", :clang_build => 421 }, | 
					
						
							|  |  |  |       "4.5"   => { :clang => "4.1", :clang_build => 421 }, | 
					
						
							|  |  |  |       "4.5.1" => { :clang => "4.1", :clang_build => 421 }, | 
					
						
							|  |  |  |       "4.5.2" => { :clang => "4.1", :clang_build => 421 }, | 
					
						
							|  |  |  |       "4.6"   => { :clang => "4.2", :clang_build => 425 }, | 
					
						
							|  |  |  |       "4.6.1" => { :clang => "4.2", :clang_build => 425 }, | 
					
						
							|  |  |  |       "4.6.2" => { :clang => "4.2", :clang_build => 425 }, | 
					
						
							|  |  |  |       "4.6.3" => { :clang => "4.2", :clang_build => 425 }, | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |       "5.0"   => { :clang => "5.0", :clang_build => 500 }, | 
					
						
							|  |  |  |       "5.0.1" => { :clang => "5.0", :clang_build => 500 }, | 
					
						
							| 
									
										
										
										
											2013-11-05 22:19:33 -06:00
										 |  |  |       "5.0.2" => { :clang => "5.0", :clang_build => 500 }, | 
					
						
							| 
									
										
										
										
											2014-03-10 15:26:19 -05:00
										 |  |  |       "5.1"   => { :clang => "5.1", :clang_build => 503 }, | 
					
						
							| 
									
										
										
										
											2014-04-05 15:23:58 +02:00
										 |  |  |       "5.1.1" => { :clang => "5.1", :clang_build => 503 }, | 
					
						
							| 
									
										
										
										
											2014-08-07 23:43:05 +01:00
										 |  |  |       "6.0"   => { :clang => "6.0", :clang_build => 600 }, | 
					
						
							| 
									
										
										
										
											2014-09-18 10:09:14 -05:00
										 |  |  |       "6.0.1" => { :clang => "6.0", :clang_build => 600 }, | 
					
						
							| 
									
										
										
										
											2014-09-10 02:44:36 +01:00
										 |  |  |       "6.1"   => { :clang => "6.0", :clang_build => 600 }, | 
					
						
							| 
									
										
										
										
											2014-12-03 02:40:22 +00:00
										 |  |  |       "6.1.1" => { :clang => "6.0", :clang_build => 600 }, | 
					
						
							| 
									
										
										
										
											2015-03-10 00:08:43 +00:00
										 |  |  |       "6.2"   => { :clang => "6.0", :clang_build => 600 }, | 
					
						
							| 
									
										
										
										
											2015-04-09 00:55:37 +01:00
										 |  |  |       "6.3"   => { :clang => "6.1", :clang_build => 602 }, | 
					
						
							| 
									
										
										
										
											2015-04-22 05:09:40 +01:00
										 |  |  |       "6.3.1" => { :clang => "6.1", :clang_build => 602 }, | 
					
						
							| 
									
										
										
										
											2015-05-19 18:52:36 +01:00
										 |  |  |       "6.3.2" => { :clang => "6.1", :clang_build => 602 }, | 
					
						
							| 
									
										
										
										
											2015-07-08 15:21:32 +01:00
										 |  |  |       "6.4"   => { :clang => "6.1", :clang_build => 602 }, | 
					
						
							| 
									
										
										
										
											2015-10-01 05:51:35 +01:00
										 |  |  |       "7.0"   => { :clang => "7.0", :clang_build => 700 }, | 
					
						
							|  |  |  |       "7.0.1" => { :clang => "7.0", :clang_build => 700 }, | 
					
						
							| 
									
										
										
										
											2015-10-23 14:16:03 +02:00
										 |  |  |       "7.1"   => { :clang => "7.0", :clang_build => 700 }, | 
					
						
							| 
									
										
										
										
											2015-11-28 21:32:17 +00:00
										 |  |  |       "7.1.1" => { :clang => "7.0", :clang_build => 700 }, | 
					
						
							| 
									
										
										
										
											2015-12-09 05:04:19 +00:00
										 |  |  |       "7.2"   => { :clang => "7.0", :clang_build => 700 }, | 
					
						
							| 
									
										
										
										
											2016-02-07 19:29:51 +00:00
										 |  |  |       "7.2.1" => { :clang => "7.0", :clang_build => 700 }, | 
					
						
							| 
									
										
										
										
											2016-04-10 20:00:11 +01:00
										 |  |  |       "7.3"   => { :clang => "7.3", :clang_build => 703 }, | 
					
						
							| 
									
										
										
										
											2016-05-05 13:22:37 +02:00
										 |  |  |       "7.3.1" => { :clang => "7.3", :clang_build => 703 }, | 
					
						
							| 
									
										
										
										
											2016-06-14 01:59:45 +01:00
										 |  |  |       "8.0"   => { :clang => "8.0", :clang_build => 800 }, | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def compilers_standard? | 
					
						
							|  |  |  |       STANDARD_COMPILERS.fetch(Xcode.version.to_s).all? do |method, build| | 
					
						
							|  |  |  |         send(:"#{method}_version") == build | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     rescue IndexError | 
					
						
							|  |  |  |       onoe <<-EOS.undent
 | 
					
						
							|  |  |  |         Homebrew doesn't know what compiler versions ship with your version | 
					
						
							| 
									
										
										
										
											2016-05-01 14:59:39 +02:00
										 |  |  |         of Xcode (#{Xcode.version}). Please `brew update` and if that doesn't | 
					
						
							|  |  |  |         help, file an issue with the output of `brew --config`: | 
					
						
							|  |  |  |           https://github.com/Homebrew/brew/issues | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-01-22 17:48:47 -08:00
										 |  |  |         Note that we only track stable, released versions of Xcode. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |         Thanks! | 
					
						
							|  |  |  |       EOS | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-01 20:47:26 -05:00
										 |  |  |     def app_with_bundle_id(*ids) | 
					
						
							|  |  |  |       path = mdfind(*ids).first | 
					
						
							| 
									
										
										
										
											2015-08-03 13:09:07 +01:00
										 |  |  |       Pathname.new(path) unless path.nil? || path.empty? | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-01 20:47:26 -05:00
										 |  |  |     def mdfind(*ids) | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |       return [] unless OS.mac? | 
					
						
							| 
									
										
										
										
											2014-04-01 20:47:26 -05:00
										 |  |  |       (@mdfind ||= {}).fetch(ids) do | 
					
						
							| 
									
										
										
										
											2014-07-11 15:51:19 -05:00
										 |  |  |         @mdfind[ids] = Utils.popen_read("/usr/bin/mdfind", mdfind_query(*ids)).split("\n") | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-01 20:47:26 -05:00
										 |  |  |     def pkgutil_info(id) | 
					
						
							| 
									
										
										
										
											2014-04-01 20:49:11 -05:00
										 |  |  |       (@pkginfo ||= {}).fetch(id) do |key| | 
					
						
							| 
									
										
										
										
											2014-07-11 15:51:19 -05:00
										 |  |  |         @pkginfo[key] = Utils.popen_read("/usr/sbin/pkgutil", "--pkg-info", key).strip | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2014-04-01 20:47:26 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def mdfind_query(*ids) | 
					
						
							|  |  |  |       ids.map! { |id| "kMDItemCFBundleIdentifier == #{id}" }.join(" || ") | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2013-10-18 12:56:51 -05:00
										 |  |  |   end | 
					
						
							|  |  |  | end |