Skip to content

Commit

Permalink
Merge pull request #1670 from msarahan/ignore_ds_store
Browse files Browse the repository at this point in the history
ignore .DS_Store files when packaging.  Thanks, Apple.
  • Loading branch information
msarahan authored Jan 17, 2017
2 parents f81c0c4 + c34e49c commit 9395a48
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Empty file.
16 changes: 16 additions & 0 deletions tests/test-recipes/metadata/ds_store_ignored/meta.yaml
Original file line number Diff line number Diff line change
@@ -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'))"

0 comments on commit 9395a48

Please sign in to comment.