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(): |