Bug 1252170 - Disable Spotlight indexing of objdir on OS X; r?ted
Creating a .metadata_never_index file in a directory apparently
disables Spotlight indexing.
MozReview-Commit-ID: Di4DGZK6VOL
--- a/python/mozbuild/mozbuild/util.py
+++ b/python/mozbuild/mozbuild/util.py
@@ -132,16 +132,19 @@ def mkdir(path, not_indexed=False):
if not_indexed:
if sys.platform == 'win32':
if isinstance(path, str_type):
fn = _kernel32.SetFileAttributesW
else:
fn = _kernel32.SetFileAttributesA
fn(path, _FILE_ATTRIBUTE_NOT_CONTENT_INDEXED)
+ elif sys.platform == 'darwin':
+ with open(os.path.join(path, '.metadata_never_index'), 'a'):
+ pass
def simple_diff(filename, old_lines, new_lines):
"""Returns the diff between old_lines and new_lines, in unified diff form,
as a list of lines.
old_lines and new_lines are lists of non-newline terminated lines to
compare.