Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: infra/bots/assets/android_ndk_linux/create.py

Issue 2275093003: add an asset for the Linux Android NDK. (Closed)
Patch Set: v4 strips the top layer Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: infra/bots/assets/android_ndk_linux/create.py
diff --git a/infra/bots/assets/go/create.py b/infra/bots/assets/android_ndk_linux/create.py
similarity index 53%
copy from infra/bots/assets/go/create.py
copy to infra/bots/assets/android_ndk_linux/create.py
index 6ea94147e5043c458ab96a5b40841a37b4448b7e..7bde83ad0f19d88daf4ab94c60cfa16bde382fe9 100755
--- a/infra/bots/assets/go/create.py
+++ b/infra/bots/assets/android_ndk_linux/create.py
@@ -10,16 +10,22 @@
import argparse
+import glob
+import os.path
+import shutil
import subprocess
-GO_URL = "https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz"
+NDK_VER = "android-ndk-r12b"
+NDK_URL = \
+ "https://dl.google.com/android/repository/%s-linux-x86_64.zip" % NDK_VER
def create_asset(target_dir):
"""Create the asset."""
- p1 = subprocess.Popen(["curl", GO_URL], stdout=subprocess.PIPE)
- p2 = subprocess.Popen(["tar", "-C", target_dir, "-xzf" "-"], stdin=p1.stdout)
- p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
- _,_ = p2.communicate()
+ subprocess.check_call(["curl", NDK_URL, "-o", "ndk.zip"])
+ subprocess.check_call(["unzip", "ndk.zip", "-d", target_dir])
+ for f in glob.glob(os.path.join(target_dir, NDK_VER, "*")):
+ shutil.move(f, target_dir)
borenet 2016/08/26 17:08:15 Why not just create a temporary dir, download and
+ subprocess.check_call(["rm", "ndk.zip"])
def main():
« no previous file with comments | « infra/bots/assets/android_ndk_linux/common.py ('k') | infra/bots/assets/android_ndk_linux/create_and_upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698