summaryrefslogtreecommitdiff
path: root/update.py
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2020-07-15 16:46:27 -0700
committerDan Albert <danalbert@google.com>2020-07-15 17:05:52 -0700
commitf3fe50d44c7fade75c0dde511f5d626460ca8c8f (patch)
treea133b491204ba19c53531d6fe5fd2e5e8b0fcce8 /update.py
parent2f2109901da2d7e45350c2f45dce9b3167d9887f (diff)
downloadndk-f3fe50d44c7fade75c0dde511f5d626460ca8c8f.tar.gz
Update NDK prebuilt update script.
Test: used it to check in r21d. Bug: None Change-Id: I4182e4883c857488aef57a863f6ad49b6f42fcf5
Diffstat (limited to 'update.py')
-rwxr-xr-xupdate.py43
1 files changed, 9 insertions, 34 deletions
diff --git a/update.py b/update.py
index aab863099..38e15188f 100755
--- a/update.py
+++ b/update.py
@@ -91,38 +91,10 @@ def install_new_release(branch, build, install_dir):
def remove_unneeded_files(install_dir):
- for path, _dirs, files in os.walk(os.path.join(install_dir, 'platforms')):
- for file_name in files:
- if file_name.endswith('.so'):
- file_path = os.path.join(path, file_name)
- remove(file_path)
-
- for path, _dirs, files in os.walk(os.path.join(install_dir, 'sources')):
- for file_name in files:
- if file_name == 'Android.bp':
- file_path = os.path.join(path, file_name)
- remove(file_path)
-
-
-def make_symlinks(install_dir):
- old_dir = os.getcwd()
- os.chdir(os.path.join(THIS_DIR, install_dir, 'platforms'))
-
- first_api = 9
- first_lp64_api = 21
-
- for api in xrange(first_api, first_lp64_api):
- if not os.path.exists(api_str(api)):
- continue
-
- for arch in ('arch-arm64', 'arch-mips64', 'arch-x86_64'):
- src = os.path.join('..', api_str(first_lp64_api), arch)
- dst = os.path.join(api_str(api), arch)
- if os.path.islink(dst):
- os.unlink(dst)
- os.symlink(src, dst)
-
- os.chdir(old_dir)
+ shutil.rmtree(os.path.join(install_dir, 'platforms'))
+ shutil.rmtree(os.path.join(install_dir, 'sources/third_party'))
+ shutil.rmtree(os.path.join(install_dir, 'sources/android/renderscript'))
+ shutil.rmtree(os.path.join(install_dir, 'sources/android/ndk_helper'))
def commit(branch, build, install_dir):
@@ -131,7 +103,11 @@ def commit(branch, build, install_dir):
message = textwrap.dedent("""\
Update NDK prebuilts to build {build}.
- Taken from branch {branch}.""").format(branch=branch, build=build)
+ Taken from branch {branch}.
+
+ Bug: None
+ Test: treehugger
+ """).format(branch=branch, build=build)
check_call(['git', 'commit', '-m', message])
@@ -169,7 +145,6 @@ def main():
remove_old_release(install_dir)
install_new_release(args.branch, args.build, install_dir)
remove_unneeded_files(install_dir)
- make_symlinks(install_dir)
commit(args.branch, args.build, install_dir)