Ver Fonte

Print migration script steps.

Bug: 1415507
Change-Id: I6957a03380e72f1a8a1c72c3e825d452fd3ad258
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4404114
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Joanna Wang há 2 anos atrás
pai
commit
c3dd9247b7
1 ficheiros alterados com 11 adições e 1 exclusões
  1. 11 1
      infra_to_superproject.py

+ 11 - 1
infra_to_superproject.py

@@ -37,6 +37,7 @@ infra or infra_internal checkout.
 
 import subprocess
 import os
+import platform
 import sys
 import json
 from pathlib import Path
@@ -44,6 +45,7 @@ from pathlib import Path
 
 def main(argv):
   assert len(argv) == 1, 'One and only one arg expected.'
+  assert platform.system() == 'Linux', 'Non-linux OSs not supported yet.'
   destination = argv[0]
 
   # In case there is '~' in the destination string
@@ -51,9 +53,15 @@ def main(argv):
 
   Path(destination).mkdir(parents=True, exist_ok=True)
 
-  cp = subprocess.Popen(['cp', '-a', os.getcwd() + '/.', destination])
+  print(f'Copying {os.getcwd()} into {destination}')
+  cp = subprocess.Popen(
+      ['cp', '-a', os.path.join(os.getcwd(), '.'), destination],
+      stdout=subprocess.PIPE,
+      stderr=subprocess.PIPE)
   cp.wait()
+  print('Copying complete')
 
+  print(f'Deleting old {destination}/.gclient file')
   gclient_file = os.path.join(destination, '.gclient')
   with open(gclient_file, 'r') as file:
     data = file.read()
@@ -61,9 +69,11 @@ def main(argv):
 
   os.remove(gclient_file)
 
+  print('Migrating to infra/infra_superproject')
   cmds = ['fetch', '--force']
   if internal:
     cmds.append('infra_internal')
+    print('including internal code in checkout')
   else:
     cmds.append('infra')
   fetch = subprocess.Popen(cmds, cwd=destination)