Chromium Code Reviews| Index: build/android/pylib/utils/isolator.py |
| diff --git a/build/android/pylib/utils/isolator.py b/build/android/pylib/utils/isolator.py |
| index 68faa38bde3b0580c0c30028a865351a1c978641..e50caf2061267222023a24eeda8cd3e4c4938ad3 100644 |
| --- a/build/android/pylib/utils/isolator.py |
| +++ b/build/android/pylib/utils/isolator.py |
| @@ -152,6 +152,16 @@ class Isolator(object): |
| else: |
| os.remove(p) |
| + @staticmethod |
|
jbudorick
2016/04/26 15:51:49
nit: @classmethod
agrieve
2016/04/26 17:34:33
Done.
|
| + def _DestructiveMerge(src, dest): |
| + if os.path.exists(dest) and os.path.isdir(dest): |
| + for p in os.listdir(src): |
| + Isolator._DestructiveMerge(os.path.join(src, p), os.path.join(dest, p)) |
|
jbudorick
2016/04/26 15:51:49
nit: cls._DestructiveMerge
agrieve
2016/04/26 17:34:33
Done.
|
| + os.rmdir(src) |
| + else: |
| + shutil.move(src, dest) |
| + |
| + |
| def MoveOutputDeps(self): |
| """Moves files from the output directory to the top level of |
| |self._isolate_deps_dir|. |
| @@ -176,6 +186,7 @@ class Isolator(object): |
| deps_out_dir, os.path.basename(constants.GetOutDirectory())) |
| if os.path.isdir(deps_product_dir): |
| for p in os.listdir(deps_product_dir): |
| - shutil.move(os.path.join(deps_product_dir, p), self._isolate_deps_dir) |
| + Isolator._DestructiveMerge(os.path.join(deps_product_dir, p), |
| + os.path.join(self._isolate_deps_dir, p)) |
| os.rmdir(deps_product_dir) |
| os.rmdir(deps_out_dir) |