OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # This Source Code Form is subject to the terms of the Mozilla Public |
| 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 |
| 7 import io |
| 8 import os |
| 9 |
| 10 this_dir_path = os.path.dirname(os.path.realpath(__file__)) |
| 11 v8_src_path = os.path.join(this_dir_path, "third_party", "v8", "src") |
| 12 v8_gyp_path = os.path.join(v8_src_path, "v8.gyp") |
| 13 v8_gyp_backup_path = os.path.join(v8_src_path, "v8.gyp_f29d55e61904333f3ccc79202
1885dfa8dc980e2") |
| 14 |
| 15 def remove_inspector(): |
| 16 # if already patched or prebuilt V8 |
| 17 if os.path.exists(v8_gyp_backup_path) or not os.path.exists(v8_gyp_path): |
| 18 return |
| 19 os.rename(v8_gyp_path, v8_gyp_backup_path) |
| 20 with io.open(v8_gyp_backup_path) as src, io.open(v8_gyp_path, "w", newline="
\n") as dst: |
| 21 for line in src: |
| 22 if not "inspector" in line: |
| 23 dst.write(line) |
| 24 elif "inspector.gypi" in line: |
| 25 dst.write(line.replace(", 'inspector/inspector.gypi'", "")) |
| 26 |
| 27 if __name__ == '__main__': |
| 28 remove_inspector() |
OLD | NEW |