From fc65abd9c90bde81469ab5869c5f36f25baf9af7 Mon Sep 17 00:00:00 2001 From: mandeep Date: Sat, 1 Jul 2017 10:25:59 -0500 Subject: [PATCH] Sort files before they're written to the files file --- conda_build/build.py | 4 ++-- conda_build/convert.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/conda_build/build.py b/conda_build/build.py index 64ad20fbc1..44c52374c7 100644 --- a/conda_build/build.py +++ b/conda_build/build.py @@ -330,7 +330,7 @@ def write_info_files_file(m, files): if m.get_value('build/noarch_python'): fo.write('\n') elif m.noarch == 'python': - for f in files: + for f in sorted(files): if f.find("site-packages") >= 0: fo.write(f[f.find("site-packages"):] + '\n') elif f.startswith("bin") and (f not in entry_point_script_names): @@ -340,7 +340,7 @@ def write_info_files_file(m, files): else: fo.write(f + '\n') else: - for f in files: + for f in sorted(files): fo.write(f + '\n') diff --git a/conda_build/convert.py b/conda_build/convert.py index 5615036a08..0131a7d81f 100644 --- a/conda_build/convert.py +++ b/conda_build/convert.py @@ -500,16 +500,21 @@ def update_files_file(temp_dir, verbose): files_file = os.path.join(temp_dir, 'info/files') with open(files_file, 'w+') as files: + file_paths = [] for dirpath, dirnames, filenames in os.walk(temp_dir): for filename in filenames: package_file_path = os.path.join( dirpath, filename).replace(temp_dir, '').lstrip(os.sep) if not package_file_path.startswith('info'): - files.write(package_file_path + '\n') + # files.write(package_file_path + '\n') + file_paths.append(package_file_path) if verbose: print('Updating {}' .format(package_file_path)) + for file_path in sorted(file_paths): + files.write(file_path + '\n') + def create_target_archive(file_path, temp_dir, platform, output_dir): """Create the converted package's tar file.