From 5d018f6fa48c25e15d2e65fe938f3d35a8f71b4c Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Sat, 8 Apr 2017 15:56:15 -0500 Subject: [PATCH 1/2] fix bin/conda getting included in conda-build packages --- conda_build/build.py | 5 ++++- conda_build/metadata.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conda_build/build.py b/conda_build/build.py index 617b2ebcdd..c209a428a3 100644 --- a/conda_build/build.py +++ b/conda_build/build.py @@ -674,10 +674,13 @@ def bundle_conda(output, metadata, env, **kw): keep_files = set(utils.expand_globs(files, metadata.config.build_prefix)) pfx_files = set(utils.prefix_files(metadata.config.build_prefix)) initial_files = set(item for item in (pfx_files - keep_files) - if not any(keep_file.startswith(item) for keep_file in keep_files)) + if not any(keep_file == item for keep_file in keep_files)) files = post_process_files(metadata, initial_files) + assert 'bin/conda' not in files and 'Scripts/conda.exe' not in files, ("Bug in conda-build has " + "included conda binary in package. Please report this on the conda-build issue tracker.") + output_filename = ('-'.join([output['name'], metadata.version(), metadata.build_id()]) + '.tar.bz2') # first filter is so that info_files does not pick up ignored files diff --git a/conda_build/metadata.py b/conda_build/metadata.py index c5c007fe70..136ca06a5a 100644 --- a/conda_build/metadata.py +++ b/conda_build/metadata.py @@ -1305,7 +1305,6 @@ def get_output_metadata_set(self, permit_undefined_jinja=False, # this is the old, default behavior: conda package, with difference between start # set of files and end set of files - prefix_file_list = join(om.config.build_folder, 'prefix_files.txt') if os.path.isfile(prefix_file_list): with open(prefix_file_list) as f: From deb1cb10767fa42fea0dde8f8161dd57091afa8c Mon Sep 17 00:00:00 2001 From: Michael Sarahan Date: Sat, 8 Apr 2017 16:14:15 -0500 Subject: [PATCH 2/2] allow conda scripts to be present when package name is conda --- conda_build/build.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conda_build/build.py b/conda_build/build.py index c209a428a3..0c3997d262 100644 --- a/conda_build/build.py +++ b/conda_build/build.py @@ -678,8 +678,10 @@ def bundle_conda(output, metadata, env, **kw): files = post_process_files(metadata, initial_files) - assert 'bin/conda' not in files and 'Scripts/conda.exe' not in files, ("Bug in conda-build has " - "included conda binary in package. Please report this on the conda-build issue tracker.") + if output.get('name') and output.get('name') != 'conda': + assert 'bin/conda' not in files and 'Scripts/conda.exe' not in files, ("Bug in conda-build " + "has included conda binary in package. Please report this on the conda-build issue " + "tracker.") output_filename = ('-'.join([output['name'], metadata.version(), metadata.build_id()]) + '.tar.bz2')