diff --git a/conda_build/build.py b/conda_build/build.py index 4d81927eab..9f4e4243b3 100644 --- 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 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 index 0000000000..e69de29bb2 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 index 0000000000..5434fdd476 --- /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'))"