From b9c1b51e45b845debb76d8658edabca70ca56079 Mon Sep 17 00:00:00 2001 From: Kate Stone Date: Tue, 6 Sep 2016 20:57:50 +0000 Subject: =?UTF-8?q?***=20This=20commit=20represents=20a=20complete=20refor?= =?UTF-8?q?matting=20of=20the=20LLDB=20source=20code=20***=20to=20conform?= =?UTF-8?q?=20to=20clang-format=E2=80=99s=20LLVM=20style.=20=20This=20kind?= =?UTF-8?q?=20of=20mass=20change=20has=20***=20two=20obvious=20implication?= =?UTF-8?q?s:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751 --- lldb/scripts/install_custom_python.py | 65 ++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 12 deletions(-) (limited to 'lldb/scripts/install_custom_python.py') diff --git a/lldb/scripts/install_custom_python.py b/lldb/scripts/install_custom_python.py index 5a8f48a..b67f063 100644 --- a/lldb/scripts/install_custom_python.py +++ b/lldb/scripts/install_custom_python.py @@ -26,24 +26,33 @@ import os import shutil import sys + def copy_one_file(dest_dir, source_dir, filename): source_path = os.path.join(source_dir, filename) dest_path = os.path.join(dest_dir, filename) print 'Copying file %s ==> %s...' % (source_path, dest_path) shutil.copyfile(source_path, dest_path) -def copy_named_files(dest_dir, source_dir, files, extensions, copy_debug_suffix_also): + +def copy_named_files( + dest_dir, + source_dir, + files, + extensions, + copy_debug_suffix_also): for (file, ext) in itertools.product(files, extensions): copy_one_file(dest_dir, source_dir, file + '.' + ext) if copy_debug_suffix_also: copy_one_file(dest_dir, source_dir, file + '_d.' + ext) + def copy_subdirectory(dest_dir, source_dir, subdir): dest_dir = os.path.join(dest_dir, subdir) source_dir = os.path.join(source_dir, subdir) print 'Copying directory %s ==> %s...' % (source_dir, dest_dir) shutil.copytree(source_dir, dest_dir) + def copy_distro(dest_dir, dest_subdir, source_dir, source_prefix): dest_dir = os.path.join(dest_dir, dest_subdir) @@ -54,11 +63,19 @@ def copy_distro(dest_dir, dest_subdir, source_dir, source_prefix): if source_prefix: PCbuild_dir = os.path.join(PCbuild_dir, source_prefix) # First copy the files that go into the root of the new distribution. This - # includes the Python executables, python27(_d).dll, and relevant PDB files. + # includes the Python executables, python27(_d).dll, and relevant PDB + # files. print 'Copying Python executables...' - copy_named_files(dest_dir, PCbuild_dir, ['w9xpopen'], ['exe', 'pdb'], False) - copy_named_files(dest_dir, PCbuild_dir, ['python_d', 'pythonw_d'], ['exe'], False) - copy_named_files(dest_dir, PCbuild_dir, ['python', 'pythonw'], ['exe', 'pdb'], False) + copy_named_files( + dest_dir, PCbuild_dir, ['w9xpopen'], [ + 'exe', 'pdb'], False) + copy_named_files( + dest_dir, PCbuild_dir, [ + 'python_d', 'pythonw_d'], ['exe'], False) + copy_named_files( + dest_dir, PCbuild_dir, [ + 'python', 'pythonw'], [ + 'exe', 'pdb'], False) copy_named_files(dest_dir, PCbuild_dir, ['python27'], ['dll', 'pdb'], True) # Next copy everything in the Include directory. @@ -83,8 +100,17 @@ def copy_distro(dest_dir, dest_subdir, source_dir, source_prefix): copy_subdirectory(tools_dest_dir, tools_source_dir, 'versioncheck') copy_subdirectory(tools_dest_dir, tools_source_dir, 'webchecker') - pyd_names = ['_ctypes', '_ctypes_test', '_elementtree', '_multiprocessing', '_socket', - '_testcapi', 'pyexpat', 'select', 'unicodedata', 'winsound'] + pyd_names = [ + '_ctypes', + '_ctypes_test', + '_elementtree', + '_multiprocessing', + '_socket', + '_testcapi', + 'pyexpat', + 'select', + 'unicodedata', + 'winsound'] # Copy builtin extension modules (pyd files) dlls_dir = os.path.join(dest_dir, 'DLLs') @@ -100,11 +126,26 @@ def copy_distro(dest_dir, dest_subdir, source_dir, source_prefix): copy_named_files(libs_dir, PCbuild_dir, ['python27'], ['lib'], True) -parser = argparse.ArgumentParser(description='Install a custom Python distribution') -parser.add_argument('--source', required=True, help='The root of the source tree where Python is built.') -parser.add_argument('--dest', required=True, help='The location to install the Python distributions.') -parser.add_argument('--overwrite', default=False, action='store_true', help='If the destination directory already exists, destroys its contents first.') -parser.add_argument('--silent', default=False, action='store_true', help='If --overwite was specified, suppress confirmation before deleting a directory tree.') +parser = argparse.ArgumentParser( + description='Install a custom Python distribution') +parser.add_argument( + '--source', + required=True, + help='The root of the source tree where Python is built.') +parser.add_argument( + '--dest', + required=True, + help='The location to install the Python distributions.') +parser.add_argument( + '--overwrite', + default=False, + action='store_true', + help='If the destination directory already exists, destroys its contents first.') +parser.add_argument( + '--silent', + default=False, + action='store_true', + help='If --overwite was specified, suppress confirmation before deleting a directory tree.') args = parser.parse_args() -- cgit v1.1