]> khamidou — GitHub mirrors - electron.git/commitdiff
Checkout boto in our repo
authorCheng Zhao <zcbenz@gmail.com>
Fri, 3 Jul 2015 14:52:26 +0000 (22:52 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 3 Jul 2015 15:33:49 +0000 (23:33 +0800)
.gitmodules
script/bootstrap.py
script/lib/util.py
vendor/boto [new submodule]

index 5517d4434f386b8ffe51cc84b865f9cd65cb2bab..c6e53ed39a69a1226fea8f88baf108dd9db2e410 100644 (file)
@@ -19,3 +19,6 @@
 [submodule "vendor/requests"]
        path = vendor/requests
        url = https://github.com/kennethreitz/requests
+[submodule "vendor/boto"]
+       path = vendor/boto
+       url = https://github.com/boto/boto.git
index 94a566224c365ff1eebdc0e37cb6d7ef32f0b406..293d3dc2dd101fa3fdc7edb77d9c17aa165b3060 100755 (executable)
@@ -37,7 +37,7 @@ def main():
     update_clang()
 
   update_submodules()
-  setup_requests()
+  setup_python_libs()
   update_node_modules('.')
   bootstrap_brightray(args.dev, args.url, args.target_arch)
 
@@ -85,9 +85,10 @@ def update_submodules():
   execute_stdout(['git', 'submodule', 'update', '--init', '--recursive'])
 
 
-def setup_requests():
-  with scoped_cwd(os.path.join(VENDOR_DIR, 'requests')):
-    execute_stdout([sys.executable, 'setup.py', 'build'])
+def setup_python_libs():
+  for lib in ('requests', 'boto'):
+    with scoped_cwd(os.path.join(VENDOR_DIR, lib)):
+      execute_stdout([sys.executable, 'setup.py', 'build'])
 
 
 def bootstrap_brightray(is_dev, url, target_arch):
index d7559ff7f718fb58ff299f5696a9ea15744c98ac..01112947da957f0bab728ef693b542ab3012333c 100644 (file)
@@ -209,8 +209,18 @@ def parse_version(version):
 
 
 def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
+  env = os.environ.copy()
+  BOTO_DIR = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'vendor',
+                                          'boto'))
+  env['PYTHONPATH'] = os.path.pathsep.join([
+    env.get('PYTHONPATH', ''),
+    os.path.join(BOTO_DIR, 'build', 'lib'),
+    os.path.join(BOTO_DIR, 'build', 'lib.linux-x86_64-2.7')])
+
+  boto = os.path.join(BOTO_DIR, 'bin', 's3put')
   args = [
-    's3put',
+    sys.executable,
+    boto,
     '--bucket', bucket,
     '--access_key', access_key,
     '--secret_key', secret_key,
@@ -219,4 +229,4 @@ def s3put(bucket, access_key, secret_key, prefix, key_prefix, files):
     '--grant', 'public-read'
   ] + files
 
-  execute(args)
+  execute(args, env)
diff --git a/vendor/boto b/vendor/boto
new file mode 160000 (submodule)
index 0000000..f7574aa
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f7574aa6cc2c819430c1f05e9a1a1a666ef8169b