diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/scripts/install_custom_python.py | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2 |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
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
Diffstat (limited to 'lldb/scripts/install_custom_python.py')
-rw-r--r-- | lldb/scripts/install_custom_python.py | 65 |
1 files changed, 53 insertions, 12 deletions
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() |