libv8 5.3.332.38.5 → 5.6.326.50.0beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +2 -0
- data/ext/libv8/builder.rb +2 -2
- data/lib/libv8/version.rb +1 -1
- data/patches/0001-Build-a-standalone-static-library.patch +4 -4
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +16 -11
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +4 -4
- data/patches/{0005-Do-not-embed-debug-symbols-in-macOS-libraries.patch → 0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch} +4 -4
- data/vendor/depot_tools/.gitignore +4 -0
- data/vendor/depot_tools/OWNERS +0 -2
- data/vendor/depot_tools/PRESUBMIT.py +20 -23
- data/vendor/depot_tools/README.gclient.md +3 -3
- data/vendor/depot_tools/README.git-cl.md +13 -12
- data/vendor/depot_tools/README.md +2 -3
- data/vendor/depot_tools/WATCHLISTS +0 -1
- data/vendor/depot_tools/appengine_mapper.py +23 -0
- data/vendor/depot_tools/apply_issue.py +2 -8
- data/vendor/depot_tools/bootstrap/win/README.md +1 -8
- data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +6 -16
- data/vendor/depot_tools/bootstrap/win/git_version.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/checkout.py +20 -433
- data/vendor/depot_tools/cipd +73 -0
- data/vendor/depot_tools/cipd.bat +12 -0
- data/vendor/depot_tools/cipd.ps1 +57 -0
- data/vendor/depot_tools/cipd_client_version +1 -0
- data/vendor/depot_tools/clang_format.py +9 -6
- data/vendor/depot_tools/clang_format_merge_driver +8 -0
- data/vendor/depot_tools/clang_format_merge_driver.bat +11 -0
- data/vendor/depot_tools/clang_format_merge_driver.py +67 -0
- data/vendor/depot_tools/codereview.settings +3 -2
- data/vendor/depot_tools/commit_queue.py +1 -1
- data/vendor/depot_tools/cpplint.py +2 -0
- data/vendor/depot_tools/fetch.py +1 -54
- data/vendor/depot_tools/fetch_configs/android.py +2 -2
- data/vendor/depot_tools/fetch_configs/breakpad.py +2 -3
- data/vendor/depot_tools/fetch_configs/chromium.py +2 -3
- data/vendor/depot_tools/fetch_configs/crashpad.py +2 -2
- data/vendor/depot_tools/fetch_configs/dart.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartino.py +2 -3
- data/vendor/depot_tools/fetch_configs/dartium.py +2 -3
- data/vendor/depot_tools/fetch_configs/depot_tools.py +3 -6
- data/vendor/depot_tools/fetch_configs/gyp.py +2 -3
- data/vendor/depot_tools/fetch_configs/infra.py +2 -2
- data/vendor/depot_tools/fetch_configs/infra_internal.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios.py +2 -2
- data/vendor/depot_tools/fetch_configs/ios_internal.py +2 -3
- data/vendor/depot_tools/fetch_configs/mojo.py +2 -3
- data/vendor/depot_tools/fetch_configs/nacl.py +2 -3
- data/vendor/depot_tools/fetch_configs/naclports.py +2 -3
- data/vendor/depot_tools/fetch_configs/pdfium.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia.py +2 -2
- data/vendor/depot_tools/fetch_configs/skia_buildbot.py +2 -2
- data/vendor/depot_tools/fetch_configs/syzygy.py +2 -2
- data/vendor/depot_tools/fetch_configs/v8.py +2 -3
- data/vendor/depot_tools/fetch_configs/webrtc.py +5 -3
- data/vendor/depot_tools/fetch_configs/webrtc_android.py +2 -2
- data/vendor/depot_tools/fetch_configs/webrtc_ios.py +2 -2
- data/vendor/depot_tools/fix_encoding.py +6 -6
- data/vendor/depot_tools/gclient.py +136 -368
- data/vendor/depot_tools/gclient_scm.py +108 -647
- data/vendor/depot_tools/gclient_utils.py +22 -86
- data/vendor/depot_tools/gerrit_client.py +105 -0
- data/vendor/depot_tools/gerrit_util.py +174 -67
- data/vendor/depot_tools/git-crrev-parse +6 -7
- data/vendor/depot_tools/git-gs +1 -1
- data/vendor/depot_tools/git_cache.py +68 -18
- data/vendor/depot_tools/git_cherry_pick_upload.py +4 -4
- data/vendor/depot_tools/git_cl.py +1028 -961
- data/vendor/depot_tools/git_common.py +2 -3
- data/vendor/depot_tools/git_drover.py +0 -1
- data/vendor/depot_tools/git_footers.py +3 -43
- data/vendor/depot_tools/git_rebase_update.py +9 -1
- data/vendor/depot_tools/git_squash_branch.py +1 -1
- data/vendor/depot_tools/infra/config/cq.cfg +8 -1
- data/vendor/depot_tools/infra/config/recipes.cfg +1 -1
- data/vendor/depot_tools/man/html/depot_tools.html +3 -11
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +9 -9
- data/vendor/depot_tools/man/html/git-cherry-pick-upload.html +2 -2
- data/vendor/depot_tools/man/html/git-drover.html +17 -17
- data/vendor/depot_tools/man/html/git-footers.html +2 -2
- data/vendor/depot_tools/man/html/git-freeze.html +4 -4
- data/vendor/depot_tools/man/html/git-hyper-blame.html +2 -2
- data/vendor/depot_tools/man/html/git-map-branches.html +2 -2
- data/vendor/depot_tools/man/html/git-map.html +2 -2
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-downstream.html +2 -2
- data/vendor/depot_tools/man/html/git-nav-upstream.html +2 -2
- data/vendor/depot_tools/man/html/git-new-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-rebase-update.html +2 -2
- data/vendor/depot_tools/man/html/git-rename-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-reparent-branch.html +2 -2
- data/vendor/depot_tools/man/html/git-retry.html +3 -3
- data/vendor/depot_tools/man/html/git-squash-branch.html +3 -3
- data/vendor/depot_tools/man/html/git-thaw.html +2 -2
- data/vendor/depot_tools/man/html/git-upstream-diff.html +3 -3
- data/vendor/depot_tools/man/man1/git-cherry-pick-upload.1 +4 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +19 -19
- data/vendor/depot_tools/man/man1/git-footers.1 +4 -4
- data/vendor/depot_tools/man/man1/git-freeze.1 +6 -6
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map-branches.1 +4 -4
- data/vendor/depot_tools/man/man1/git-map.1 +4 -4
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +4 -4
- data/vendor/depot_tools/man/man1/git-new-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +4 -4
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +4 -4
- data/vendor/depot_tools/man/man1/git-retry.1 +5 -5
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +5 -5
- data/vendor/depot_tools/man/man1/git-thaw.1 +4 -4
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +5 -5
- data/vendor/depot_tools/man/man7/depot_tools.7 +5 -10
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +4 -4
- data/vendor/depot_tools/man/src/depot_tools.txt +1 -1
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +7 -7
- data/vendor/depot_tools/man/src/filter_demo_output.py +2 -2
- data/vendor/depot_tools/man/src/git-footers.demo.1.sh +1 -1
- data/vendor/depot_tools/man/src/git-retry.txt +1 -1
- data/vendor/depot_tools/man/src/git-squash-branch.txt +2 -2
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +1 -1
- data/vendor/depot_tools/my_activity.py +6 -3
- data/vendor/depot_tools/my_reviews.py +1 -1
- data/vendor/depot_tools/ninja +2 -2
- data/vendor/depot_tools/ninja-linux32 +0 -0
- data/vendor/depot_tools/ninja-linux64 +0 -0
- data/vendor/depot_tools/ninja-mac +0 -0
- data/vendor/depot_tools/ninja.exe +0 -0
- data/vendor/depot_tools/owners.py +14 -3
- data/vendor/depot_tools/presubmit_canned_checks.py +46 -67
- data/vendor/depot_tools/presubmit_support.py +109 -371
- data/vendor/depot_tools/pylintrc +83 -56
- data/vendor/depot_tools/recipe_modules/OWNERS +1 -0
- data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +18 -9
- data/vendor/depot_tools/recipe_modules/bot_update/api.py +56 -55
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/buildbot.json +52 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +19 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +3 -7
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +2 -54
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +56 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/{forced.json → trychange_oauth2_json.json} +6 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +54 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +59 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +9 -9
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +20 -10
- data/vendor/depot_tools/recipe_modules/bot_update/example.py +45 -63
- data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +210 -807
- data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +34 -45
- data/vendor/depot_tools/recipe_modules/cipd/api.py +59 -84
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/basic.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-failed.json +14 -60
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/describe-many-instances.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/mac64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/win64.json +71 -117
- data/vendor/depot_tools/recipe_modules/cipd/example.py +2 -12
- data/vendor/depot_tools/recipe_modules/cipd/test_api.py +0 -9
- data/vendor/depot_tools/recipe_modules/depot_tools/api.py +6 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/basic.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.expected/win.json +7 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/example.py +3 -0
- data/vendor/depot_tools/recipe_modules/gclient/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gclient/api.py +9 -22
- data/vendor/depot_tools/recipe_modules/gclient/config.py +18 -5
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +14 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/buildbot.json +211 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +16 -14
- data/vendor/depot_tools/recipe_modules/gclient/example.py +13 -11
- data/vendor/depot_tools/recipe_modules/gerrit/__init__.py +6 -0
- data/vendor/depot_tools/recipe_modules/gerrit/api.py +63 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.expected/basic.json +64 -0
- data/vendor/depot_tools/recipe_modules/gerrit/example.py +35 -0
- data/vendor/depot_tools/recipe_modules/gerrit/test_api.py +24 -0
- data/vendor/depot_tools/recipe_modules/git/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git/api.py +155 -142
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +13 -13
- data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +45 -19
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +8 -8
- data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +44 -18
- data/vendor/depot_tools/recipe_modules/git/example.expected/git-cache-checkout.json +48 -22
- data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +42 -16
- data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +43 -17
- data/vendor/depot_tools/recipe_modules/git/example.py +9 -3
- data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git_cl/api.py +8 -8
- data/vendor/depot_tools/recipe_modules/git_cl/example.py +1 -1
- data/vendor/depot_tools/recipe_modules/gsutil/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/gsutil/api.py +196 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.expected/basic.json +186 -0
- data/vendor/depot_tools/recipe_modules/gsutil/example.py +77 -0
- data/vendor/depot_tools/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +3 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/api.py +20 -3
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_linux.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_mac.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_swarmbucket_win.json +3 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/example.py +6 -1
- data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +4 -6
- data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
- data/vendor/depot_tools/recipe_modules/rietveld/api.py +12 -9
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +2 -24
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/buildbot.json +30 -0
- data/vendor/depot_tools/recipe_modules/rietveld/example.py +12 -6
- data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/tryserver/api.py +46 -70
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/set_failure_hash_with_no_steps.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/{with_svn_patch.json → with_gerrit_patch.json} +1 -31
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_gerrit_patch_deprecated.json +39 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +2 -2
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +8 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +3 -3
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +1 -1
- data/vendor/depot_tools/recipe_modules/tryserver/example.py +35 -5
- data/vendor/depot_tools/recipes.py +52 -28
- data/vendor/depot_tools/repo +216 -69
- data/vendor/depot_tools/rietveld.py +20 -15
- data/vendor/depot_tools/roll_dep.py +1 -1
- data/vendor/depot_tools/scm.py +11 -826
- data/vendor/depot_tools/subprocess2.py +5 -5
- data/vendor/depot_tools/third_party/cq_client/README.depot_tools.md +2 -0
- data/vendor/depot_tools/third_party/cq_client/README.md +5 -1
- data/vendor/depot_tools/third_party/cq_client/cq.pb.go +183 -104
- data/vendor/depot_tools/third_party/cq_client/cq.proto +43 -27
- data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +95 -29
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_both.cfg +67 -0
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +1 -2
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_rietveld.cfg +0 -3
- data/vendor/depot_tools/third_party/upload.py +44 -24
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +0 -5
- metadata +38 -93
- data/patches/0004-Reinterpret-thread-hash-for-FreeBSD-too.patch +0 -25
- data/vendor/depot_tools/git-auto-svn +0 -6
- data/vendor/depot_tools/git_auto_svn.py +0 -122
- data/vendor/depot_tools/man/html/git-auto-svn.html +0 -837
- data/vendor/depot_tools/man/man1/git-auto-svn.1 +0 -113
- data/vendor/depot_tools/man/src/_git-auto-svn_desc.helper.txt +0 -1
- data/vendor/depot_tools/man/src/git-auto-svn.txt +0 -69
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +0 -43
- data/vendor/depot_tools/recipe_modules/cipd/example.expected/install-failed.json +0 -31
- data/vendor/depot_tools/recipe_modules/cipd/resources/bootstrap.py +0 -218
- data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +0 -7
- data/vendor/depot_tools/third_party/gsutil/CHECKSUM +0 -1
- data/vendor/depot_tools/third_party/gsutil/COPYING +0 -202
- data/vendor/depot_tools/third_party/gsutil/LICENSE.third_party +0 -295
- data/vendor/depot_tools/third_party/gsutil/MANIFEST.in +0 -5
- data/vendor/depot_tools/third_party/gsutil/README +0 -38
- data/vendor/depot_tools/third_party/gsutil/README.chromium +0 -25
- data/vendor/depot_tools/third_party/gsutil/README.pkg +0 -49
- data/vendor/depot_tools/third_party/gsutil/ReleaseNotes.txt +0 -825
- data/vendor/depot_tools/third_party/gsutil/VERSION +0 -1
- data/vendor/depot_tools/third_party/gsutil/gslib/README +0 -5
- data/vendor/depot_tools/third_party/gsutil/gslib/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/acls.py +0 -234
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/anon.py +0 -57
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/command_opts.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/dev.py +0 -139
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/metadata.py +0 -186
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/naming.py +0 -173
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/prod.py +0 -160
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/projects.py +0 -130
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/subdirs.py +0 -110
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/support.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/versioning.py +0 -242
- data/vendor/depot_tools/third_party/gsutil/gslib/addlhelp/wildcards.py +0 -170
- data/vendor/depot_tools/third_party/gsutil/gslib/bucket_listing_ref.py +0 -175
- data/vendor/depot_tools/third_party/gsutil/gslib/command.py +0 -725
- data/vendor/depot_tools/third_party/gsutil/gslib/command_runner.py +0 -102
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/__init__.py +0 -15
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cat.py +0 -131
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/chacl.py +0 -523
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/config.py +0 -662
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/cp.py +0 -1819
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/disablelogging.py +0 -101
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/enablelogging.py +0 -149
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getacl.py +0 -82
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getcors.py +0 -121
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getdefacl.py +0 -86
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getlogging.py +0 -137
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getversioning.py +0 -116
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/getwebcfg.py +0 -122
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/help.py +0 -218
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/ls.py +0 -578
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mb.py +0 -172
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/mv.py +0 -159
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/perfdiag.py +0 -903
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rb.py +0 -113
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/rm.py +0 -237
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setacl.py +0 -138
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setcors.py +0 -145
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setdefacl.py +0 -105
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setmeta.py +0 -420
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setversioning.py +0 -114
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/setwebcfg.py +0 -190
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/update.py +0 -305
- data/vendor/depot_tools/third_party/gsutil/gslib/commands/version.py +0 -150
- data/vendor/depot_tools/third_party/gsutil/gslib/exception.py +0 -76
- data/vendor/depot_tools/third_party/gsutil/gslib/help_provider.py +0 -81
- data/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.py +0 -550
- data/vendor/depot_tools/third_party/gsutil/gslib/no_op_auth_plugin.py +0 -30
- data/vendor/depot_tools/third_party/gsutil/gslib/plurality_checkable_iterator.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/project_id.py +0 -67
- data/vendor/depot_tools/third_party/gsutil/gslib/storage_uri_builder.py +0 -56
- data/vendor/depot_tools/third_party/gsutil/gslib/thread_pool.py +0 -79
- data/vendor/depot_tools/third_party/gsutil/gslib/util.py +0 -167
- data/vendor/depot_tools/third_party/gsutil/gslib/wildcard_iterator.py +0 -498
- data/vendor/depot_tools/third_party/gsutil/gsutil +0 -384
- data/vendor/depot_tools/third_party/gsutil/gsutil.spec.in +0 -75
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/__init__.py +0 -22
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client.py +0 -630
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_client_test.py +0 -374
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_helper.py +0 -103
- data/vendor/depot_tools/third_party/gsutil/oauth2_plugin/oauth2_plugin.py +0 -24
- data/vendor/depot_tools/third_party/gsutil/pkg_util.py +0 -60
- data/vendor/depot_tools/third_party/gsutil/plugins/__init__.py +0 -0
- data/vendor/depot_tools/third_party/gsutil/plugins/sso_auth.py +0 -105
@@ -1,114 +0,0 @@
|
|
1
|
-
# Copyright 2012 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
from gslib.command import Command
|
16
|
-
from gslib.command import COMMAND_NAME
|
17
|
-
from gslib.command import COMMAND_NAME_ALIASES
|
18
|
-
from gslib.command import CONFIG_REQUIRED
|
19
|
-
from gslib.command import FILE_URIS_OK
|
20
|
-
from gslib.command import MAX_ARGS
|
21
|
-
from gslib.command import MIN_ARGS
|
22
|
-
from gslib.command import PROVIDER_URIS_OK
|
23
|
-
from gslib.command import SUPPORTED_SUB_ARGS
|
24
|
-
from gslib.command import URIS_START_ARG
|
25
|
-
from gslib.exception import CommandException
|
26
|
-
from gslib.help_provider import HELP_NAME
|
27
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
28
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
29
|
-
from gslib.help_provider import HELP_TEXT
|
30
|
-
from gslib.help_provider import HelpType
|
31
|
-
from gslib.help_provider import HELP_TYPE
|
32
|
-
from gslib.util import NO_MAX
|
33
|
-
|
34
|
-
|
35
|
-
_detailed_help_text = ("""
|
36
|
-
<B>SYNOPSIS</B>
|
37
|
-
gsutil setversioning [on|off] bucket_uri...
|
38
|
-
|
39
|
-
|
40
|
-
<B>DESCRIPTION</B>
|
41
|
-
The Versioning Configuration feature enables you to configure a Google Cloud
|
42
|
-
Storage bucket to keep old versions of objects.
|
43
|
-
|
44
|
-
The gsutil setversioning command allows you to enable or suspend versioning
|
45
|
-
on one or more buckets.
|
46
|
-
""")
|
47
|
-
|
48
|
-
class SetVersioningCommand(Command):
|
49
|
-
"""Implementation of gsutil setversioning command."""
|
50
|
-
|
51
|
-
# Command specification (processed by parent class).
|
52
|
-
command_spec = {
|
53
|
-
# Name of command.
|
54
|
-
COMMAND_NAME : 'setversioning',
|
55
|
-
# List of command name aliases.
|
56
|
-
COMMAND_NAME_ALIASES : [],
|
57
|
-
# Min number of args required by this command.
|
58
|
-
MIN_ARGS : 1,
|
59
|
-
# Max number of args required by this command, or NO_MAX.
|
60
|
-
MAX_ARGS : NO_MAX,
|
61
|
-
# Getopt-style string specifying acceptable sub args.
|
62
|
-
SUPPORTED_SUB_ARGS : '',
|
63
|
-
# True if file URIs acceptable for this command.
|
64
|
-
FILE_URIS_OK : False,
|
65
|
-
# True if provider-only URIs acceptable for this command.
|
66
|
-
PROVIDER_URIS_OK : False,
|
67
|
-
# Index in args of first URI arg.
|
68
|
-
URIS_START_ARG : 1,
|
69
|
-
# True if must configure gsutil before running command.
|
70
|
-
CONFIG_REQUIRED : True,
|
71
|
-
}
|
72
|
-
help_spec = {
|
73
|
-
# Name of command or auxiliary help info for which this help applies.
|
74
|
-
HELP_NAME : 'setversioning',
|
75
|
-
# List of help name aliases.
|
76
|
-
HELP_NAME_ALIASES : [],
|
77
|
-
# Type of help)
|
78
|
-
HELP_TYPE : HelpType.COMMAND_HELP,
|
79
|
-
# One line summary of this help.
|
80
|
-
HELP_ONE_LINE_SUMMARY : 'Enable or suspend versioning for one or more '
|
81
|
-
'buckets',
|
82
|
-
# The full help text.
|
83
|
-
HELP_TEXT : _detailed_help_text,
|
84
|
-
}
|
85
|
-
|
86
|
-
|
87
|
-
# Command entry point.
|
88
|
-
def RunCommand(self):
|
89
|
-
versioning_arg = self.args[0].lower()
|
90
|
-
if not versioning_arg in ('on', 'off'):
|
91
|
-
raise CommandException('Argument to %s must be either [on|off]'
|
92
|
-
% (self.command_name))
|
93
|
-
uri_args = self.args[1:]
|
94
|
-
|
95
|
-
# Iterate over URIs, expanding wildcards, and setting the website
|
96
|
-
# configuration on each.
|
97
|
-
some_matched = False
|
98
|
-
for uri_str in uri_args:
|
99
|
-
for blr in self.WildcardIterator(uri_str):
|
100
|
-
uri = blr.GetUri()
|
101
|
-
if not uri.names_bucket():
|
102
|
-
raise CommandException('URI %s must name a bucket for the %s command'
|
103
|
-
% (str(uri), self.command_name))
|
104
|
-
some_matched = True
|
105
|
-
if versioning_arg == 'on':
|
106
|
-
print 'Enabling versioning for %s...' % uri
|
107
|
-
uri.configure_versioning(True)
|
108
|
-
else:
|
109
|
-
print 'Suspending versioning for %s...' % uri
|
110
|
-
uri.configure_versioning(False)
|
111
|
-
if not some_matched:
|
112
|
-
raise CommandException('No URIs matched')
|
113
|
-
|
114
|
-
return 0
|
@@ -1,190 +0,0 @@
|
|
1
|
-
# Copyright 2012 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
from gslib.command import Command
|
16
|
-
from gslib.command import COMMAND_NAME
|
17
|
-
from gslib.command import COMMAND_NAME_ALIASES
|
18
|
-
from gslib.command import CONFIG_REQUIRED
|
19
|
-
from gslib.command import FILE_URIS_OK
|
20
|
-
from gslib.command import MAX_ARGS
|
21
|
-
from gslib.command import MIN_ARGS
|
22
|
-
from gslib.command import PROVIDER_URIS_OK
|
23
|
-
from gslib.command import SUPPORTED_SUB_ARGS
|
24
|
-
from gslib.command import URIS_START_ARG
|
25
|
-
from gslib.exception import CommandException
|
26
|
-
from gslib.help_provider import HELP_NAME
|
27
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
28
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
29
|
-
from gslib.help_provider import HELP_TEXT
|
30
|
-
from gslib.help_provider import HelpType
|
31
|
-
from gslib.help_provider import HELP_TYPE
|
32
|
-
from gslib.util import NO_MAX
|
33
|
-
|
34
|
-
|
35
|
-
_detailed_help_text = ("""
|
36
|
-
<B>SYNOPSIS</B>
|
37
|
-
gsutil setwebcfg [-m main_page_suffix] [-e error_page] bucket_uri...
|
38
|
-
|
39
|
-
|
40
|
-
<B>DESCRIPTION</B>
|
41
|
-
The Website Configuration feature enables you to configure a Google Cloud
|
42
|
-
Storage bucket to behave like a static website. This means requests made via a
|
43
|
-
domain-named bucket aliased using a Domain Name System "CNAME" to
|
44
|
-
c.storage.googleapis.com will work like any other website, i.e., a GET to the
|
45
|
-
bucket will serve the configured "main" page instead of the usual bucket
|
46
|
-
listing and a GET for a non-existent object will serve the configured error
|
47
|
-
page.
|
48
|
-
|
49
|
-
For example, suppose your company's Domain name is example.com. You could set
|
50
|
-
up a website bucket as follows:
|
51
|
-
|
52
|
-
1. Create a bucket called example.com (see the "DOMAIN NAMED BUCKETS"
|
53
|
-
section of "gsutil help naming" for details about creating such buckets).
|
54
|
-
|
55
|
-
2. Create index.html and 404.html files and upload them to the bucket.
|
56
|
-
|
57
|
-
3. Configure the bucket to have website behavior using the command:
|
58
|
-
|
59
|
-
gsutil setwebcfg -m index.html -e 404.html gs://example.com
|
60
|
-
|
61
|
-
4. Add a DNS CNAME record for example.com pointing to c.storage.googleapis.com
|
62
|
-
(ask your DNS administrator for help with this).
|
63
|
-
|
64
|
-
Now if you open a browser and navigate to http://example.com, it will display
|
65
|
-
the main page instead of the default bucket listing. Note: It can take time
|
66
|
-
for DNS updates to propagate because of caching used by the DNS, so it may
|
67
|
-
take up to a day for the domain-named bucket website to work after you create
|
68
|
-
the CNAME DNS record.
|
69
|
-
|
70
|
-
Additional notes:
|
71
|
-
|
72
|
-
1. Because the main page is only served when a bucket listing request is made
|
73
|
-
via the CNAME alias, you can continue to use "gsutil ls" to list the bucket
|
74
|
-
and get the normal bucket listing (rather than the main page).
|
75
|
-
|
76
|
-
2. The main_page_suffix applies to each subdirectory of the bucket. For
|
77
|
-
example, with the main_page_suffix configured to be index.html, a GET
|
78
|
-
request for http://example.com would retrieve
|
79
|
-
http://example.com/index.html, and a GET request for
|
80
|
-
http://example.com/photos would retrieve
|
81
|
-
http://example.com/photos/index.html.
|
82
|
-
|
83
|
-
2. There is just one 404.html page: For example, a GET request for
|
84
|
-
http://example.com/photos/missing would retrieve
|
85
|
-
http://example.com/404.html, not http://example.com/photos/404.html.
|
86
|
-
|
87
|
-
3. For additional details see
|
88
|
-
https://developers.google.com/storage/docs/website-configuration.
|
89
|
-
|
90
|
-
|
91
|
-
<B>OPTIONS</B>
|
92
|
-
-m index.html Specifies the object name to serve when a bucket listing
|
93
|
-
is requested via the CNAME alias to
|
94
|
-
c.storage.googleapis.com.
|
95
|
-
|
96
|
-
-e 404.html Specifies the error page to serve when a request is made
|
97
|
-
for a non-existing object, via the is requested via the
|
98
|
-
CNAME alias to c.storage.googleapis.com.
|
99
|
-
""")
|
100
|
-
|
101
|
-
def BuildGSWebConfig(main_page_suffix=None, not_found_page=None):
|
102
|
-
config_body_l = ['<WebsiteConfiguration>']
|
103
|
-
if main_page_suffix:
|
104
|
-
config_body_l.append('<MainPageSuffix>%s</MainPageSuffix>' %
|
105
|
-
main_page_suffix)
|
106
|
-
if not_found_page:
|
107
|
-
config_body_l.append('<NotFoundPage>%s</NotFoundPage>' %
|
108
|
-
not_found_page)
|
109
|
-
config_body_l.append('</WebsiteConfiguration>')
|
110
|
-
return "".join(config_body_l)
|
111
|
-
|
112
|
-
def BuildS3WebConfig(main_page_suffix=None, error_page=None):
|
113
|
-
config_body_l = ['<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">']
|
114
|
-
if not main_page_suffix:
|
115
|
-
raise CommandException('S3 requires main page / index document')
|
116
|
-
config_body_l.append('<IndexDocument><Suffix>%s</Suffix></IndexDocument>' %
|
117
|
-
main_page_suffix)
|
118
|
-
if error_page:
|
119
|
-
config_body_l.append('<ErrorDocument><Key>%s</Key></ErrorDocument>' %
|
120
|
-
error_page)
|
121
|
-
config_body_l.append('</WebsiteConfiguration>')
|
122
|
-
return "".join(config_body_l)
|
123
|
-
|
124
|
-
class SetWebcfgCommand(Command):
|
125
|
-
"""Implementation of gsutil setwebcfg command."""
|
126
|
-
|
127
|
-
# Command specification (processed by parent class).
|
128
|
-
command_spec = {
|
129
|
-
# Name of command.
|
130
|
-
COMMAND_NAME : 'setwebcfg',
|
131
|
-
# List of command name aliases.
|
132
|
-
COMMAND_NAME_ALIASES : [],
|
133
|
-
# Min number of args required by this command.
|
134
|
-
MIN_ARGS : 1,
|
135
|
-
# Max number of args required by this command, or NO_MAX.
|
136
|
-
MAX_ARGS : NO_MAX,
|
137
|
-
# Getopt-style string specifying acceptable sub args.
|
138
|
-
SUPPORTED_SUB_ARGS : 'm:e:',
|
139
|
-
# True if file URIs acceptable for this command.
|
140
|
-
FILE_URIS_OK : False,
|
141
|
-
# True if provider-only URIs acceptable for this command.
|
142
|
-
PROVIDER_URIS_OK : False,
|
143
|
-
# Index in args of first URI arg.
|
144
|
-
URIS_START_ARG : 1,
|
145
|
-
# True if must configure gsutil before running command.
|
146
|
-
CONFIG_REQUIRED : True,
|
147
|
-
}
|
148
|
-
help_spec = {
|
149
|
-
# Name of command or auxiliary help info for which this help applies.
|
150
|
-
HELP_NAME : 'setwebcfg',
|
151
|
-
# List of help name aliases.
|
152
|
-
HELP_NAME_ALIASES : [],
|
153
|
-
# Type of help)
|
154
|
-
HELP_TYPE : HelpType.COMMAND_HELP,
|
155
|
-
# One line summary of this help.
|
156
|
-
HELP_ONE_LINE_SUMMARY : 'Set a main page and/or error page for one or more buckets',
|
157
|
-
# The full help text.
|
158
|
-
HELP_TEXT : _detailed_help_text,
|
159
|
-
}
|
160
|
-
|
161
|
-
|
162
|
-
# Command entry point.
|
163
|
-
def RunCommand(self):
|
164
|
-
main_page_suffix = None
|
165
|
-
error_page = None
|
166
|
-
if self.sub_opts:
|
167
|
-
for o, a in self.sub_opts:
|
168
|
-
if o == '-m':
|
169
|
-
main_page_suffix = a
|
170
|
-
elif o == '-e':
|
171
|
-
error_page = a
|
172
|
-
|
173
|
-
uri_args = self.args
|
174
|
-
|
175
|
-
# Iterate over URIs, expanding wildcards, and setting the website
|
176
|
-
# configuration on each.
|
177
|
-
some_matched = False
|
178
|
-
for uri_str in uri_args:
|
179
|
-
for blr in self.WildcardIterator(uri_str):
|
180
|
-
uri = blr.GetUri()
|
181
|
-
if not uri.names_bucket():
|
182
|
-
raise CommandException('URI %s must name a bucket for the %s command'
|
183
|
-
% (str(uri), self.command_name))
|
184
|
-
some_matched = True
|
185
|
-
print 'Setting website config on %s...' % uri
|
186
|
-
uri.set_website_config(main_page_suffix, error_page)
|
187
|
-
if not some_matched:
|
188
|
-
raise CommandException('No URIs matched')
|
189
|
-
|
190
|
-
return 0
|
@@ -1,305 +0,0 @@
|
|
1
|
-
# Copyright 2011 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
import os
|
16
|
-
import platform
|
17
|
-
import shutil
|
18
|
-
import signal
|
19
|
-
import sys
|
20
|
-
import tarfile
|
21
|
-
import tempfile
|
22
|
-
|
23
|
-
from boto import config
|
24
|
-
from gslib.command import Command
|
25
|
-
from gslib.command import COMMAND_NAME
|
26
|
-
from gslib.command import COMMAND_NAME_ALIASES
|
27
|
-
from gslib.command import CONFIG_REQUIRED
|
28
|
-
from gslib.command import FILE_URIS_OK
|
29
|
-
from gslib.command import MAX_ARGS
|
30
|
-
from gslib.command import MIN_ARGS
|
31
|
-
from gslib.command import PROVIDER_URIS_OK
|
32
|
-
from gslib.command import SUPPORTED_SUB_ARGS
|
33
|
-
from gslib.command import URIS_START_ARG
|
34
|
-
from gslib.exception import CommandException
|
35
|
-
from gslib.help_provider import HELP_NAME
|
36
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
37
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
38
|
-
from gslib.help_provider import HELP_TEXT
|
39
|
-
from gslib.help_provider import HelpType
|
40
|
-
from gslib.help_provider import HELP_TYPE
|
41
|
-
|
42
|
-
_detailed_help_text = ("""
|
43
|
-
<B>SYNOPSIS</B>
|
44
|
-
gsutil update [-f] [uri]
|
45
|
-
|
46
|
-
|
47
|
-
<B>DESCRIPTION</B>
|
48
|
-
The gsutil update command downloads the latest gsutil release, checks its
|
49
|
-
version, and offers to let you update to it if it differs from the version
|
50
|
-
you're currently running.
|
51
|
-
|
52
|
-
Once you say "Y" to the prompt of whether to install the update, the gsutil
|
53
|
-
update command locates where the running copy of gsutil is installed,
|
54
|
-
unpacks the new version into an adjacent directory, moves the previous version
|
55
|
-
aside, moves the new version to where the previous version was installed,
|
56
|
-
and removes the moved-aside old version. Because of this, users are cautioned
|
57
|
-
not to store data in the gsutil directory, since that data will be lost
|
58
|
-
when you update gsutil. (Some users change directories into the gsutil
|
59
|
-
directory to run the command. We advise against doing that, for this reason.)
|
60
|
-
|
61
|
-
By default gsutil update will retrieve the new code from
|
62
|
-
gs://pub/gsutil.tar.gz, but you can optionally specify a URI to use
|
63
|
-
instead. This is primarily used for distributing pre-release versions of
|
64
|
-
the code to a small group of early test users.
|
65
|
-
|
66
|
-
|
67
|
-
<B>OPTIONS</B>
|
68
|
-
-f Forces the update command to offer to let you update, even if you
|
69
|
-
have the most current copy already. This can be useful if you have
|
70
|
-
a corrupted local copy.
|
71
|
-
""")
|
72
|
-
|
73
|
-
|
74
|
-
class UpdateCommand(Command):
|
75
|
-
"""Implementation of gsutil update command."""
|
76
|
-
|
77
|
-
# Command specification (processed by parent class).
|
78
|
-
command_spec = {
|
79
|
-
# Name of command.
|
80
|
-
COMMAND_NAME : 'update',
|
81
|
-
# List of command name aliases.
|
82
|
-
COMMAND_NAME_ALIASES : ['refresh'],
|
83
|
-
# Min number of args required by this command.
|
84
|
-
MIN_ARGS : 0,
|
85
|
-
# Max number of args required by this command, or NO_MAX.
|
86
|
-
MAX_ARGS : 1,
|
87
|
-
# Getopt-style string specifying acceptable sub args.
|
88
|
-
SUPPORTED_SUB_ARGS : 'f',
|
89
|
-
# True if file URIs acceptable for this command.
|
90
|
-
FILE_URIS_OK : False,
|
91
|
-
# True if provider-only URIs acceptable for this command.
|
92
|
-
PROVIDER_URIS_OK : False,
|
93
|
-
# Index in args of first URI arg.
|
94
|
-
URIS_START_ARG : 0,
|
95
|
-
# True if must configure gsutil before running command.
|
96
|
-
CONFIG_REQUIRED : True,
|
97
|
-
}
|
98
|
-
help_spec = {
|
99
|
-
# Name of command or auxiliary help info for which this help applies.
|
100
|
-
HELP_NAME : 'update',
|
101
|
-
# List of help name aliases.
|
102
|
-
HELP_NAME_ALIASES : ['refresh'],
|
103
|
-
# Type of help:
|
104
|
-
HELP_TYPE : HelpType.COMMAND_HELP,
|
105
|
-
# One line summary of this help.
|
106
|
-
HELP_ONE_LINE_SUMMARY : 'Update to the latest gsutil release',
|
107
|
-
# The full help text.
|
108
|
-
HELP_TEXT : _detailed_help_text,
|
109
|
-
}
|
110
|
-
|
111
|
-
def _ExplainIfSudoNeeded(self, tf, dirs_to_remove):
|
112
|
-
"""Explains what to do if sudo needed to update gsutil software.
|
113
|
-
|
114
|
-
Happens if gsutil was previously installed by a different user (typically if
|
115
|
-
someone originally installed in a shared file system location, using sudo).
|
116
|
-
|
117
|
-
Args:
|
118
|
-
tf: Opened TarFile.
|
119
|
-
dirs_to_remove: List of directories to remove.
|
120
|
-
|
121
|
-
Raises:
|
122
|
-
CommandException: if errors encountered.
|
123
|
-
"""
|
124
|
-
system = platform.system()
|
125
|
-
# If running under Windows we don't need (or have) sudo.
|
126
|
-
if system.lower().startswith('windows'):
|
127
|
-
return
|
128
|
-
|
129
|
-
user_id = os.getuid()
|
130
|
-
if (os.stat(self.gsutil_bin_dir).st_uid == user_id
|
131
|
-
and os.stat(self.boto_lib_dir).st_uid == user_id):
|
132
|
-
return
|
133
|
-
|
134
|
-
# Won't fail - this command runs after main startup code that insists on
|
135
|
-
# having a config file.
|
136
|
-
config_files = ' '.join(self.config_file_list)
|
137
|
-
self._CleanUpUpdateCommand(tf, dirs_to_remove)
|
138
|
-
raise CommandException(
|
139
|
-
('Since it was installed by a different user previously, you will need '
|
140
|
-
'to update using the following commands.\nYou will be prompted for '
|
141
|
-
'your password, and the install will run as "root". If you\'re unsure '
|
142
|
-
'what this means please ask your system administrator for help:'
|
143
|
-
'\n\tchmod 644 %s\n\tsudo env BOTO_CONFIG=%s gsutil update'
|
144
|
-
'\n\tchmod 600 %s') % (config_files, config_files, config_files),
|
145
|
-
informational=True)
|
146
|
-
|
147
|
-
# This list is checked during gsutil update by doing a lowercased
|
148
|
-
# slash-left-stripped check. For example "/Dev" would match the "dev" entry.
|
149
|
-
unsafe_update_dirs = [
|
150
|
-
'applications', 'auto', 'bin', 'boot', 'desktop', 'dev',
|
151
|
-
'documents and settings', 'etc', 'export', 'home', 'kernel', 'lib',
|
152
|
-
'lib32', 'library', 'lost+found', 'mach_kernel', 'media', 'mnt', 'net',
|
153
|
-
'null', 'network', 'opt', 'private', 'proc', 'program files', 'python',
|
154
|
-
'root', 'sbin', 'scripts', 'srv', 'sys', 'system', 'tmp', 'users', 'usr',
|
155
|
-
'var', 'volumes', 'win', 'win32', 'windows', 'winnt',
|
156
|
-
]
|
157
|
-
|
158
|
-
def _EnsureDirsSafeForUpdate(self, dirs):
|
159
|
-
"""Throws Exception if any of dirs is known to be unsafe for gsutil update.
|
160
|
-
|
161
|
-
This provides a fail-safe check to ensure we don't try to overwrite
|
162
|
-
or delete any important directories. (That shouldn't happen given the
|
163
|
-
way we construct tmp dirs, etc., but since the gsutil update cleanup
|
164
|
-
uses shutil.rmtree() it's prudent to add extra checks.)
|
165
|
-
|
166
|
-
Args:
|
167
|
-
dirs: List of directories to check.
|
168
|
-
|
169
|
-
Raises:
|
170
|
-
CommandException: If unsafe directory encountered.
|
171
|
-
"""
|
172
|
-
for d in dirs:
|
173
|
-
if not d:
|
174
|
-
d = 'null'
|
175
|
-
if d.lstrip(os.sep).lower() in self.unsafe_update_dirs:
|
176
|
-
raise CommandException('EnsureDirsSafeForUpdate: encountered unsafe '
|
177
|
-
'directory (%s); aborting update' % d)
|
178
|
-
|
179
|
-
def _CleanUpUpdateCommand(self, tf, dirs_to_remove):
|
180
|
-
"""Cleans up temp files etc. from running update command.
|
181
|
-
|
182
|
-
Args:
|
183
|
-
tf: Opened TarFile.
|
184
|
-
dirs_to_remove: List of directories to remove.
|
185
|
-
|
186
|
-
"""
|
187
|
-
tf.close()
|
188
|
-
self._EnsureDirsSafeForUpdate(dirs_to_remove)
|
189
|
-
for directory in dirs_to_remove:
|
190
|
-
try:
|
191
|
-
shutil.rmtree(directory)
|
192
|
-
except OSError as e:
|
193
|
-
# Ignore errors while attempting to remove old dirs under Windows. They
|
194
|
-
# happen because of Windows exclusive file locking, and the update
|
195
|
-
# actually succeeds but just leaves the old versions around in the
|
196
|
-
# user's temp dir.
|
197
|
-
if not platform.system().lower().startswith('windows'):
|
198
|
-
raise
|
199
|
-
|
200
|
-
# Command entry point.
|
201
|
-
def RunCommand(self):
|
202
|
-
for cfg_var in ('is_secure', 'https_validate_certificates'):
|
203
|
-
if (config.has_option('Boto', cfg_var)
|
204
|
-
and not config.getboolean('Boto', cfg_var)):
|
205
|
-
raise CommandException('Your boto configuration has %s = False. '
|
206
|
-
'The update command\ncannot be run this way, for '
|
207
|
-
'security reasons.' % cfg_var)
|
208
|
-
dirs_to_remove = []
|
209
|
-
# Retrieve gsutil tarball and check if it's newer than installed code.
|
210
|
-
# TODO: Store this version info as metadata on the tarball object and
|
211
|
-
# change this command's implementation to check that metadata instead of
|
212
|
-
# downloading the tarball to check the version info.
|
213
|
-
tmp_dir = tempfile.mkdtemp()
|
214
|
-
dirs_to_remove.append(tmp_dir)
|
215
|
-
os.chdir(tmp_dir)
|
216
|
-
print 'Checking for software update...'
|
217
|
-
if len(self.args):
|
218
|
-
update_from_uri_str = self.args[0]
|
219
|
-
if not update_from_uri_str.endswith('.tar.gz'):
|
220
|
-
raise CommandException(
|
221
|
-
'The update command only works with tar.gz files.')
|
222
|
-
else:
|
223
|
-
update_from_uri_str = 'gs://pub/gsutil.tar.gz'
|
224
|
-
self.command_runner.RunNamedCommand('cp', [update_from_uri_str,
|
225
|
-
'file://gsutil.tar.gz'],
|
226
|
-
self.headers, self.debug)
|
227
|
-
# Note: tf is closed in _CleanUpUpdateCommand.
|
228
|
-
tf = tarfile.open('gsutil.tar.gz')
|
229
|
-
tf.errorlevel = 1 # So fatal tarball unpack errors raise exceptions.
|
230
|
-
tf.extract('./gsutil/VERSION')
|
231
|
-
|
232
|
-
ver_file = open('gsutil/VERSION', 'r')
|
233
|
-
try:
|
234
|
-
latest_version_string = ver_file.read().rstrip('\n')
|
235
|
-
finally:
|
236
|
-
ver_file.close()
|
237
|
-
|
238
|
-
force_update = False
|
239
|
-
if self.sub_opts:
|
240
|
-
for o, unused_a in self.sub_opts:
|
241
|
-
if o == '-f':
|
242
|
-
force_update = True
|
243
|
-
if not force_update and self.gsutil_ver == latest_version_string:
|
244
|
-
self._CleanUpUpdateCommand(tf, dirs_to_remove)
|
245
|
-
if len(self.args):
|
246
|
-
raise CommandException('You already have %s installed.' %
|
247
|
-
update_from_uri_str, informational=True)
|
248
|
-
else:
|
249
|
-
raise CommandException('You already have the latest gsutil release '
|
250
|
-
'installed.', informational=True)
|
251
|
-
|
252
|
-
print(('This command will update to the "%s" version of\ngsutil at %s') %
|
253
|
-
(latest_version_string, self.gsutil_bin_dir))
|
254
|
-
self._ExplainIfSudoNeeded(tf, dirs_to_remove)
|
255
|
-
|
256
|
-
answer = raw_input('Proceed? [y/N] ')
|
257
|
-
if not answer or answer.lower()[0] != 'y':
|
258
|
-
self._CleanUpUpdateCommand(tf, dirs_to_remove)
|
259
|
-
raise CommandException('Not running update.', informational=True)
|
260
|
-
|
261
|
-
# Ignore keyboard interrupts during the update to reduce the chance someone
|
262
|
-
# hitting ^C leaves gsutil in a broken state.
|
263
|
-
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
264
|
-
|
265
|
-
# self.gsutil_bin_dir lists the path where the code should end up (like
|
266
|
-
# /usr/local/gsutil), which is one level down from the relative path in the
|
267
|
-
# tarball (since the latter creates files in ./gsutil). So, we need to
|
268
|
-
# extract at the parent directory level.
|
269
|
-
gsutil_bin_parent_dir = os.path.dirname(self.gsutil_bin_dir)
|
270
|
-
|
271
|
-
# Extract tarball to a temporary directory in a sibling to gsutil_bin_dir.
|
272
|
-
old_dir = tempfile.mkdtemp(dir=gsutil_bin_parent_dir)
|
273
|
-
new_dir = tempfile.mkdtemp(dir=gsutil_bin_parent_dir)
|
274
|
-
dirs_to_remove.append(old_dir)
|
275
|
-
dirs_to_remove.append(new_dir)
|
276
|
-
self._EnsureDirsSafeForUpdate(dirs_to_remove)
|
277
|
-
try:
|
278
|
-
tf.extractall(path=new_dir)
|
279
|
-
except Exception, e:
|
280
|
-
self._CleanUpUpdateCommand(tf, dirs_to_remove)
|
281
|
-
raise CommandException('Update failed: %s.' % e)
|
282
|
-
|
283
|
-
# For enterprise mode (shared/central) installation, users with
|
284
|
-
# different user/group than the installation user/group must be
|
285
|
-
# able to run gsutil so we need to do some permissions adjustments
|
286
|
-
# here. Since enterprise mode is not not supported for Windows
|
287
|
-
# users, we can skip this step when running on Windows, which
|
288
|
-
# avoids the problem that Windows has no find or xargs command.
|
289
|
-
system = platform.system()
|
290
|
-
if not system.lower().startswith('windows'):
|
291
|
-
# Make all files and dirs in updated area readable by other
|
292
|
-
# and make all directories executable by other. These steps
|
293
|
-
os.system('chmod -R o+r ' + new_dir)
|
294
|
-
os.system('find ' + new_dir + ' -type d | xargs chmod o+x')
|
295
|
-
|
296
|
-
# Make main gsutil script readable and executable by other.
|
297
|
-
os.system('chmod o+rx ' + os.path.join(new_dir, 'gsutil'))
|
298
|
-
|
299
|
-
# Move old installation aside and new into place.
|
300
|
-
os.rename(self.gsutil_bin_dir, old_dir + os.sep + 'old')
|
301
|
-
os.rename(new_dir + os.sep + 'gsutil', self.gsutil_bin_dir)
|
302
|
-
self._CleanUpUpdateCommand(tf, dirs_to_remove)
|
303
|
-
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
304
|
-
print 'Update complete.'
|
305
|
-
return 0
|