Repository: conda/conda-build

Issue:
.DS_Store breaks conda build
```
Fixing permissions
BUILD END: python-3.5.0b2-0
'lib/.DS_Store' not in info/files
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:

    https://github.com/conda/conda-build/issues

Include the output of the command 'conda info' in your report.


Traceback (most recent call last):
  File "/Users/aaronmeurer/anaconda/bin/conda-build", line 5, in <module>
    sys.exit(main())
  File "/Users/aaronmeurer/Documents/Continuum/conda-build/conda_build/main_build.py", line 127, in main
    args_func(args, p)
  File "/Users/aaronmeurer/Documents/Continuum/conda-build/conda_build/main_build.py", line 346, in args_func
    args.func(args, p)
  File "/Users/aaronmeurer/Documents/Continuum/conda-build/conda_build/main_build.py", line 305, in execute
    channel_urls=channel_urls, override_channels=args.override_channels)
  File "/Users/aaronmeurer/Documents/Continuum/conda-build/conda_build/build.py", line 421, in build
    tarcheck.check_all(path)
  File "/Users/aaronmeurer/Documents/Continuum/conda-build/conda_build/tarcheck.py", line 59, in check_all
    x.info_files()
  File "/Users/aaronmeurer/Documents/Continuum/conda-build/conda_build/tarcheck.py", line 46, in info_files
    raise Exception('info/files')
Exception: info/files
```



Discussion:
I have a similar problem [here](https://github.com/conda-forge/staged-recipes/pull/2189)

Resolving patch:
diff --git a/conda_build/build.py b/conda_build/build.py
--- a/conda_build/build.py
+++ b/conda_build/build.py
@@ -781,7 +781,8 @@ def warn_on_old_conda_build(index=None, installed_version=None, available_packag
 """ % (installed_version, available_packages[-1]), file=sys.stderr)
 
 
-def filter_files(files_list, prefix, filter_patterns=('(.*[\\\\/])?\.git[\\\\/].*', )):
+def filter_files(files_list, prefix, filter_patterns=('(.*[\\\\/])?\.git[\\\\/].*',
+                                                      '(.*)?\.DS_Store.*')):
     """Remove things like .git from the list of files to be copied"""
     for pattern in filter_patterns:
         r = re.compile(pattern)
@@ -808,11 +809,11 @@ def bundle_conda(output, metadata, config, env, **kw):
     output_filename = ('-'.join([output['name'], metadata.version(),
                                  build_string_from_metadata(tmp_metadata)]) + '.tar.bz2')
     files = list(set(utils.expand_globs(files, config.build_prefix)))
+    files = filter_files(files, prefix=config.build_prefix)
     info_files = create_info_files(tmp_metadata, files, config=config, prefix=config.build_prefix)
     for f in info_files:
         if f not in files:
             files.append(f)
-    files = filter_files(files, prefix=config.build_prefix)
 
     # lock the output directory while we build this file
     # create the tarball in a temporary directory to minimize lock time


Test patch:
diff --git a/tests/test-recipes/metadata/ds_store_ignored/.DS_Store b/tests/test-recipes/metadata/ds_store_ignored/.DS_Store
new file mode 100644
diff --git a/tests/test-recipes/metadata/ds_store_ignored/meta.yaml b/tests/test-recipes/metadata/ds_store_ignored/meta.yaml
new file mode 100644
--- /dev/null
+++ b/tests/test-recipes/metadata/ds_store_ignored/meta.yaml
@@ -0,0 +1,16 @@
+package:
+  name: test_has_ds_store
+  version: 1.0
+
+source:
+  path: .
+
+build:
+  script:
+    - cp .DS_Store $PREFIX
+
+test:
+  requires:
+    - python
+  commands:
+    - python -c "import os; assert not os.path.isfile(os.path.join(os.getenv('PREFIX'), '.DS_Store'))"