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,242 +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.help_provider import HELP_NAME
|
16
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
17
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
18
|
-
from gslib.help_provider import HelpProvider
|
19
|
-
from gslib.help_provider import HELP_TEXT
|
20
|
-
from gslib.help_provider import HelpType
|
21
|
-
from gslib.help_provider import HELP_TYPE
|
22
|
-
|
23
|
-
_detailed_help_text = ("""
|
24
|
-
<B>OVERVIEW</B>
|
25
|
-
Versioning-enabled buckets maintain an archive of objects, providing a way to
|
26
|
-
un-delete data that you accidentally deleted, or to retrieve older versions of
|
27
|
-
your data. You can turn versioning on or off for a bucket at any time. Turning
|
28
|
-
versioning off leaves existing object versions in place, and simply causes the
|
29
|
-
bucket to stop accumulating new object versions. In this case, if you upload
|
30
|
-
to an existing object the current version is overwritten instead of creating
|
31
|
-
a new version.
|
32
|
-
|
33
|
-
Regardless of whether you have enabled versioning on a bucket, every object
|
34
|
-
has two associated positive integer fields:
|
35
|
-
- the generation, which is updated when the content of an object is
|
36
|
-
overwritten.
|
37
|
-
- the meta-generation, which identifies the metadata generation. It starts
|
38
|
-
at 1; is updated every time the metadata (e.g., ACL or Content-Type) for a
|
39
|
-
given content generation is updated; and gets reset when the generation
|
40
|
-
number changes.
|
41
|
-
|
42
|
-
Of these two integers, only the generation is used when working with versioned
|
43
|
-
data. Both generation and meta-generation can be used with concurrency control
|
44
|
-
(discussed in a later section).
|
45
|
-
|
46
|
-
To work with object versioning in gsutil, you can use a flavor of storage URIs
|
47
|
-
that that embed the object generation, which we refer to as version-specific URIs.
|
48
|
-
For example, the version-less object URI:
|
49
|
-
|
50
|
-
gs://bucket/object
|
51
|
-
|
52
|
-
might have have two versions, with these version-specific URIs:
|
53
|
-
|
54
|
-
gs://bucket/object#1360383693690000
|
55
|
-
gs://bucket/object#1360383802725000
|
56
|
-
|
57
|
-
The following sections discuss how to work with versioning and concurrency
|
58
|
-
control.
|
59
|
-
|
60
|
-
|
61
|
-
<B>OBJECT VERSIONING</B>
|
62
|
-
You can view, enable, and disable object versioning on a bucket using
|
63
|
-
the getversioning and setversioning commands. For example:
|
64
|
-
|
65
|
-
gsutil setversioning on gs://bucket
|
66
|
-
|
67
|
-
will enable versioning for the named bucket. See 'gsutil help getversioning'
|
68
|
-
and 'gsutil help setversioning' for additional details.
|
69
|
-
|
70
|
-
To see all object versions in a versioning-enabled bucket along with
|
71
|
-
their generation.meta-generation information, use gsutil ls -a:
|
72
|
-
|
73
|
-
gsutil ls -a gs://bucket
|
74
|
-
|
75
|
-
You can also specify particular objects for which you want to find the
|
76
|
-
version-specific URI(s), or you can use wildcards:
|
77
|
-
|
78
|
-
gsutil ls -a gs://bucket/object1 gs://bucket/images/*.jpg
|
79
|
-
|
80
|
-
The generation values form a monotonically increasing sequence as you create
|
81
|
-
additional object versions. Because of this, the latest object version is
|
82
|
-
always the last one listed in the gsutil ls output for a particular object.
|
83
|
-
For example, if a bucket contains these three versions of gs://bucket/object:
|
84
|
-
|
85
|
-
gs://bucket/object#1360035307075000
|
86
|
-
gs://bucket/object#1360101007329000
|
87
|
-
gs://bucket/object#1360102216114000
|
88
|
-
|
89
|
-
then gs://bucket/object#1360102216114000 is the latest version and
|
90
|
-
gs://bucket/object#1360035307075000 is the oldest available version.
|
91
|
-
|
92
|
-
If you specify version-less URIs with gsutil, you will operate on the
|
93
|
-
latest not-deleted version of an object, for example:
|
94
|
-
|
95
|
-
gsutil cp gs://bucket/object ./dir
|
96
|
-
|
97
|
-
or
|
98
|
-
|
99
|
-
gsutil rm gs://bucket/object
|
100
|
-
|
101
|
-
To operate on a specific object version, use a version-specific URI.
|
102
|
-
For example, suppose the output of the above gsutil ls -a command is:
|
103
|
-
|
104
|
-
gs://bucket/object#1360035307075000
|
105
|
-
gs://bucket/object#1360101007329000
|
106
|
-
|
107
|
-
In this case, the command:
|
108
|
-
|
109
|
-
gsutil cp gs://bucket/object#1360035307075000 ./dir
|
110
|
-
|
111
|
-
will retrieve the second most recent version of the object.
|
112
|
-
|
113
|
-
Note that version-specific URIs cannot be the target of the gsutil cp
|
114
|
-
command (trying to do so will result in an error), because writing to a
|
115
|
-
versioned object always creates a new version.
|
116
|
-
|
117
|
-
If an object has been deleted, it will not show up in a normal gsutil ls
|
118
|
-
listing (i.e., ls without the -a option). You can restore a deleted object by
|
119
|
-
running gsutil ls -a to find the available versions, and then copying one of
|
120
|
-
the version-specific URIs to the version-less URI, for example:
|
121
|
-
|
122
|
-
gsutil cp gs://bucket/object#1360101007329000 gs://bucket/object
|
123
|
-
|
124
|
-
Note that when you do this it creates a new object version, which will incur
|
125
|
-
additional charges. You can get rid of the extra copy by deleting the older
|
126
|
-
version-specfic object:
|
127
|
-
|
128
|
-
gsutil rm gs://bucket/object#1360101007329000
|
129
|
-
|
130
|
-
Or you can combine the two steps by using the gsutil mv command:
|
131
|
-
|
132
|
-
gsutil mv gs://bucket/object#1360101007329000 gs://bucket/object
|
133
|
-
|
134
|
-
If you want to remove all versions of an object use the gsutil rm -a option:
|
135
|
-
|
136
|
-
gsutil rm -a gs://bucket/object
|
137
|
-
|
138
|
-
Note that there is no limit to the number of older versions of an object you
|
139
|
-
will create if you continue to upload to the same object in a versioning-
|
140
|
-
enabled bucket. It is your responsibility to delete versions beyond the ones
|
141
|
-
you want to retain.
|
142
|
-
|
143
|
-
|
144
|
-
<B>CONCURRENCY CONTROL</B>
|
145
|
-
If you are building an application using Google Cloud Storage, you may need to
|
146
|
-
be careful about concurrency control. Normally gsutil itself isn't used for
|
147
|
-
this purpose, but it's possible to write scripts around gsutil that perform
|
148
|
-
concurrency control.
|
149
|
-
|
150
|
-
For example, suppose you want to implement a "rolling update" system using
|
151
|
-
gsutil, where a periodic job computes some data and uploads it to the cloud.
|
152
|
-
On each run, the job starts with the data that it computed from last run, and
|
153
|
-
computes a new value. To make this system robust, you need to have multiple
|
154
|
-
machines on which the job can run, which raises the possibility that two
|
155
|
-
simultaneous runs could attempt to update an object at the same time. This
|
156
|
-
leads to the following potential race condition:
|
157
|
-
- job 1 computes the new value to be written
|
158
|
-
- job 2 computes the new value to be written
|
159
|
-
- job 2 writes the new value
|
160
|
-
- job 1 writes the new value
|
161
|
-
|
162
|
-
In this case, the value that job 1 read is no longer current by the time
|
163
|
-
it goes to write the updated object, and writing at this point would result
|
164
|
-
in stale (or, depending on the application, corrupt) data.
|
165
|
-
|
166
|
-
To prevent this, you can find the version-specific name of the object that was
|
167
|
-
created, and then use the information contained in that URI to specify an
|
168
|
-
x-goog-if-generation-match header on a subsequent gsutil cp command. You can
|
169
|
-
do this in two steps. First, use the gsutil cp -v option at upload time to get
|
170
|
-
the version-specific name of the object that was created, for example:
|
171
|
-
|
172
|
-
gsutil cp -v file gs://bucket/object
|
173
|
-
|
174
|
-
might output:
|
175
|
-
|
176
|
-
Created: gs://bucket/object#1360432179236000
|
177
|
-
|
178
|
-
You can extract the generation value from this object and then construct a
|
179
|
-
subsequent gsutil command like this:
|
180
|
-
|
181
|
-
gsutil -h x-goog-if-generation-match:1360432179236000 cp newfile \\
|
182
|
-
gs://bucket/object
|
183
|
-
|
184
|
-
This command requests Google Cloud Storage to attempt to upload newfile
|
185
|
-
but to fail the request if the generation of newfile that is live at the
|
186
|
-
time of the upload does not match that specified.
|
187
|
-
|
188
|
-
If the command you use updates object metadata, you will need to find the
|
189
|
-
current meta_generation for an object. To do this, use the gsutil ls -a and
|
190
|
-
-l options. For example, the command:
|
191
|
-
|
192
|
-
gsutil ls -l -a gs://bucket/object
|
193
|
-
|
194
|
-
will output something like:
|
195
|
-
|
196
|
-
64 2013-02-12T19:59:13 gs://bucket/object#1360699153986000 meta_generation=3
|
197
|
-
1521 2013-02-13T02:04:08 gs://bucket/object#1360721048778000 meta_generation=2
|
198
|
-
|
199
|
-
Given this information, you could use the following command to request setting
|
200
|
-
the ACL on the older version of the object, such that the command will fail
|
201
|
-
unless that is the current version of the data+metadata:
|
202
|
-
|
203
|
-
gsutil -h x-goog-if-generation-match:1360699153986000 -h \\
|
204
|
-
x-goog-if-metageneration-match:3 setacl public-read \\
|
205
|
-
gs://bucket/object#1360699153986000
|
206
|
-
|
207
|
-
Without adding these headers, the update would simply overwrite the existing
|
208
|
-
ACL. Note that in contrast, the gsutil chacl command uses these headers
|
209
|
-
automatically, because it performs a read-modify-write cycle in order to edit
|
210
|
-
ACLs.
|
211
|
-
|
212
|
-
If you want to experiment with how generations and metagenerations work, try
|
213
|
-
the following. First, upload an object; then use gsutil ls -l -a to list all
|
214
|
-
versions of the object, along with each version's meta_generation; then re-
|
215
|
-
upload the object and repeat the gsutil ls -l -a. You should see two object
|
216
|
-
versions, each with meta_generation=1. Now try setting the ACL, and rerun the
|
217
|
-
gsutil ls -l -a. You should see the most recent object generation now has
|
218
|
-
meta_generation=2.
|
219
|
-
|
220
|
-
|
221
|
-
<B>FOR MORE INFORMATION</B>
|
222
|
-
For more details on how to use versioning and preconditions, see
|
223
|
-
https://developers.google.com/storage/docs/object-versioning
|
224
|
-
""")
|
225
|
-
|
226
|
-
|
227
|
-
class CommandOptions(HelpProvider):
|
228
|
-
"""Additional help about object versioning."""
|
229
|
-
|
230
|
-
help_spec = {
|
231
|
-
# Name of command or auxiliary help info for which this help applies.
|
232
|
-
HELP_NAME : 'versioning',
|
233
|
-
# List of help name aliases.
|
234
|
-
HELP_NAME_ALIASES : ['concurrency', 'concurrency control', 'versioning',
|
235
|
-
'versions'],
|
236
|
-
# Type of help:
|
237
|
-
HELP_TYPE : HelpType.ADDITIONAL_HELP,
|
238
|
-
# One line summary of this help.
|
239
|
-
HELP_ONE_LINE_SUMMARY : 'Working with object versions; concurrency control',
|
240
|
-
# The full help text.
|
241
|
-
HELP_TEXT : _detailed_help_text,
|
242
|
-
}
|
@@ -1,170 +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.help_provider import HELP_NAME
|
16
|
-
from gslib.help_provider import HELP_NAME_ALIASES
|
17
|
-
from gslib.help_provider import HELP_ONE_LINE_SUMMARY
|
18
|
-
from gslib.help_provider import HelpProvider
|
19
|
-
from gslib.help_provider import HELP_TEXT
|
20
|
-
from gslib.help_provider import HelpType
|
21
|
-
from gslib.help_provider import HELP_TYPE
|
22
|
-
|
23
|
-
_detailed_help_text = ("""
|
24
|
-
<B>DESCRIPTION</B>
|
25
|
-
gsutil supports URI wildcards. For example, the command:
|
26
|
-
|
27
|
-
gsutil cp gs://bucket/data/abc* .
|
28
|
-
|
29
|
-
will copy all objects that start with gs://bucket/data/abc followed by any
|
30
|
-
number of characters within that subdirectory.
|
31
|
-
|
32
|
-
|
33
|
-
<B>DIRECTORY BY DIRECTORY VS RECURSIVE WILDCARDS</B>
|
34
|
-
The "*" wildcard only matches up to the end of a path within
|
35
|
-
a subdirectory. For example, if bucket contains objects
|
36
|
-
named gs://bucket/data/abcd, gs://bucket/data/abcdef,
|
37
|
-
and gs://bucket/data/abcxyx, as well as an object in a sub-directory
|
38
|
-
(gs://bucket/data/abc/def) the above gsutil cp command would match the
|
39
|
-
first 3 object names but not the last one.
|
40
|
-
|
41
|
-
If you want matches to span directory boundaries, use a '**' wildcard:
|
42
|
-
|
43
|
-
gsutil cp gs://bucket/data/abc** .
|
44
|
-
|
45
|
-
will match all four objects above.
|
46
|
-
|
47
|
-
Note that gsutil supports the same wildcards for both objects and file names.
|
48
|
-
Thus, for example:
|
49
|
-
|
50
|
-
gsutil cp data/abc* gs://bucket
|
51
|
-
|
52
|
-
will match all names in the local file system. Most command shells also
|
53
|
-
support wildcarding, so if you run the above command probably your shell
|
54
|
-
is expanding the matches before running gsutil. However, most shells do not
|
55
|
-
support recursive wildcards ('**'), and you can cause gsutil's wildcarding
|
56
|
-
support to work for such shells by single-quoting the arguments so they
|
57
|
-
don't get interpreted by the shell before being passed to gsutil:
|
58
|
-
|
59
|
-
gsutil cp 'data/abc**' gs://bucket
|
60
|
-
|
61
|
-
|
62
|
-
<B>BUCKET WILDCARDS</B>
|
63
|
-
You can specify wildcards for bucket names. For example:
|
64
|
-
|
65
|
-
gsutil ls gs://data*.example.com
|
66
|
-
|
67
|
-
will list the contents of all buckets whose name starts with "data" and
|
68
|
-
ends with ".example.com".
|
69
|
-
|
70
|
-
You can also combine bucket and object name wildcards. For example this
|
71
|
-
command will remove all ".txt" files in any of your Google Cloud Storage
|
72
|
-
buckets:
|
73
|
-
|
74
|
-
gsutil rm gs://*/**.txt
|
75
|
-
|
76
|
-
|
77
|
-
<B>OTHER WILDCARD CHARACTERS</B>
|
78
|
-
In addition to '*', you can use these wildcards:
|
79
|
-
|
80
|
-
? Matches a single character. For example "gs://bucket/??.txt"
|
81
|
-
only matches objects with two characters followed by .txt.
|
82
|
-
|
83
|
-
[chars] Match any of the specified characters. For example
|
84
|
-
"gs://bucket/[aeiou].txt" matches objects that contain a single vowel
|
85
|
-
character followed by .txt
|
86
|
-
|
87
|
-
[char range] Match any of the range of characters. For example
|
88
|
-
"gs://bucket/[a-m].txt" matches objects that contain letters
|
89
|
-
a, b, c, ... or m, and end with .txt.
|
90
|
-
|
91
|
-
You can combine wildcards to provide more powerful matches, for example:
|
92
|
-
gs://bucket/[a-m]??.j*g
|
93
|
-
|
94
|
-
|
95
|
-
<B>EFFICIENCY CONSIDERATION: USING WILDCARDS OVER MANY OBJECTS</B>
|
96
|
-
It is more efficient, faster, and less network traffic-intensive
|
97
|
-
to use wildcards that have a non-wildcard object-name prefix, like:
|
98
|
-
|
99
|
-
gs://bucket/abc*.txt
|
100
|
-
|
101
|
-
than it is to use wildcards as the first part of the object name, like:
|
102
|
-
|
103
|
-
gs://bucket/*abc.txt
|
104
|
-
|
105
|
-
This is because the request for "gs://bucket/abc*.txt" asks the server
|
106
|
-
to send back the subset of results whose object names start with "abc",
|
107
|
-
and then gsutil filters the result list for objects whose name ends with
|
108
|
-
".txt". In contrast, "gs://bucket/*abc.txt" asks the server for the complete
|
109
|
-
list of objects in the bucket and then filters for those objects whose name
|
110
|
-
ends with "abc.txt". This efficiency consideration becomes increasingly
|
111
|
-
noticeable when you use buckets containing thousands or more objects. It is
|
112
|
-
sometimes possible to set up the names of your objects to fit with expected
|
113
|
-
wildcard matching patterns, to take advantage of the efficiency of doing
|
114
|
-
server-side prefix requests. See, for example "gsutil help prod" for a
|
115
|
-
concrete use case example.
|
116
|
-
|
117
|
-
|
118
|
-
<B>EFFICIENCY CONSIDERATION: USING MID-PATH WILDCARDS</B>
|
119
|
-
Suppose you have a bucket with these objects:
|
120
|
-
gs://bucket/obj1
|
121
|
-
gs://bucket/obj2
|
122
|
-
gs://bucket/obj3
|
123
|
-
gs://bucket/obj4
|
124
|
-
gs://bucket/dir1/obj5
|
125
|
-
gs://bucket/dir2/obj6
|
126
|
-
|
127
|
-
If you run the command:
|
128
|
-
gsutil ls gs://bucket/*/obj5
|
129
|
-
gsutil will perform a /-delimited top-level bucket listing and then one bucket
|
130
|
-
listing for each subdirectory, for a total of 3 bucket listings:
|
131
|
-
GET /bucket/?delimiter=/
|
132
|
-
GET /bucket/?prefix=dir1/obj5&delimiter=/
|
133
|
-
GET /bucket/?prefix=dir2/obj5&delimiter=/
|
134
|
-
|
135
|
-
The more bucket listings your wildcard requires, the slower and more expensive
|
136
|
-
it will be. The number of bucket listings required grows as:
|
137
|
-
- the number of wildcard components (e.g., "gs://bucket/a??b/c*/*/d"
|
138
|
-
has 3 wildcard components);
|
139
|
-
- the number of subdirectories that match each component; and
|
140
|
-
- the number of results (pagination is implemented using one GET
|
141
|
-
request per 1000 results, specifying markers for each).
|
142
|
-
|
143
|
-
If you want to use a mid-path wildcard, you might try instead using a
|
144
|
-
recursive wildcard, for example:
|
145
|
-
|
146
|
-
gsutil ls gs://bucket/**/obj5
|
147
|
-
|
148
|
-
This will match more objects than gs://bucket/*/obj5 (since it spans
|
149
|
-
directories), but is implemented using a delimiter-less bucket listing
|
150
|
-
request (which means fewer bucket requests, though it will list the entire
|
151
|
-
bucket and filter locally, so that could require a non-trivial amount of
|
152
|
-
network traffic).
|
153
|
-
""")
|
154
|
-
|
155
|
-
|
156
|
-
class CommandOptions(HelpProvider):
|
157
|
-
"""Additional help about wildcards."""
|
158
|
-
|
159
|
-
help_spec = {
|
160
|
-
# Name of command or auxiliary help info for which this help applies.
|
161
|
-
HELP_NAME : 'wildcards',
|
162
|
-
# List of help name aliases.
|
163
|
-
HELP_NAME_ALIASES : ['wildcard', '*', '**'],
|
164
|
-
# Type of help:
|
165
|
-
HELP_TYPE : HelpType.ADDITIONAL_HELP,
|
166
|
-
# One line summary of this help.
|
167
|
-
HELP_ONE_LINE_SUMMARY : 'Wildcard support',
|
168
|
-
# The full help text.
|
169
|
-
HELP_TEXT : _detailed_help_text,
|
170
|
-
}
|
@@ -1,175 +0,0 @@
|
|
1
|
-
# Copyright 2012 Google Inc. All Rights Reserved.
|
2
|
-
#
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a
|
4
|
-
# copy of this software and associated documentation files (the
|
5
|
-
# "Software"), to deal in the Software without restriction, including
|
6
|
-
# without limitation the rights to use, copy, modify, merge, publish, dis-
|
7
|
-
# tribute, sublicense, and/or sell copies of the Software, and to permit
|
8
|
-
# persons to whom the Software is furnished to do so, subject to the fol-
|
9
|
-
# lowing conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be included
|
12
|
-
# in all copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
15
|
-
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
|
16
|
-
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
17
|
-
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
18
|
-
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
20
|
-
# IN THE SOFTWARE.
|
21
|
-
|
22
|
-
import time
|
23
|
-
|
24
|
-
|
25
|
-
class BucketListingRef(object):
|
26
|
-
"""
|
27
|
-
Container that holds a reference to one result from a bucket listing, allowing
|
28
|
-
polymorphic iteration over wildcard-iterated URIs, Keys, or Prefixes. At a
|
29
|
-
minimum, every reference contains a StorageUri. If the reference came from a
|
30
|
-
bucket listing (as opposed to a manually instantiated ref that might populate
|
31
|
-
only the StorageUri), it will additionally contain either a Key or a Prefix,
|
32
|
-
depending on whether it was a reference to an object or was just a prefix of a
|
33
|
-
path (i.e., bucket subdirectory). The latter happens when the bucket was
|
34
|
-
listed using delimiter='/'.
|
35
|
-
|
36
|
-
Note that Keys are shallow-populated, based on the contents extracted from
|
37
|
-
parsing a bucket listing. This includes name, length, and other fields
|
38
|
-
(basically, the info listed by gsutil ls -l), but does not include information
|
39
|
-
like ACL and location (which require separate server requests, which is why
|
40
|
-
there's a separate gsutil ls -L option to get this more detailed info).
|
41
|
-
"""
|
42
|
-
|
43
|
-
def __init__(self, uri, key=None, prefix=None, headers=None):
|
44
|
-
"""Instantiate BucketListingRef from uri and (if available) key or prefix.
|
45
|
-
|
46
|
-
Args:
|
47
|
-
uri: StorageUri for the object (required).
|
48
|
-
key: Key for the object, or None if not available.
|
49
|
-
prefix: Prefix for the subdir, or None if not available.
|
50
|
-
headers: Dictionary containing optional HTTP headers to pass to boto
|
51
|
-
(which happens when GetKey() is called on an BucketListingRef which
|
52
|
-
has no constructor-populated Key), or None if not available.
|
53
|
-
|
54
|
-
At most one of key and prefix can be populated.
|
55
|
-
"""
|
56
|
-
assert key is None or prefix is None
|
57
|
-
self.uri = uri
|
58
|
-
self.key = key
|
59
|
-
self.prefix = prefix
|
60
|
-
self.headers = headers or {}
|
61
|
-
|
62
|
-
def GetUri(self):
|
63
|
-
"""Get URI form of listed URI.
|
64
|
-
|
65
|
-
Returns:
|
66
|
-
StorageUri.
|
67
|
-
"""
|
68
|
-
return self.uri
|
69
|
-
|
70
|
-
def GetUriString(self):
|
71
|
-
"""Get string URI form of listed URI.
|
72
|
-
|
73
|
-
Returns:
|
74
|
-
String.
|
75
|
-
"""
|
76
|
-
return self.uri.uri
|
77
|
-
|
78
|
-
def NamesBucket(self):
|
79
|
-
"""Determines if this BucketListingRef names a bucket.
|
80
|
-
|
81
|
-
Returns:
|
82
|
-
bool indicator.
|
83
|
-
"""
|
84
|
-
return self.key is None and self.prefix is None and self.uri.names_bucket()
|
85
|
-
|
86
|
-
def IsLatest(self):
|
87
|
-
"""Determines if this BucketListingRef names the latest version of an
|
88
|
-
object.
|
89
|
-
|
90
|
-
Returns:
|
91
|
-
bool indicator.
|
92
|
-
"""
|
93
|
-
return hasattr(self.uri, 'is_latest') and self.uri.is_latest
|
94
|
-
|
95
|
-
def GetRStrippedUriString(self):
|
96
|
-
"""Get string URI form of listed URI, stripped of any right trailing
|
97
|
-
delims, and without version string.
|
98
|
-
|
99
|
-
Returns:
|
100
|
-
String.
|
101
|
-
"""
|
102
|
-
return self.uri.versionless_uri.rstrip('/')
|
103
|
-
|
104
|
-
def HasKey(self):
|
105
|
-
"""Return bool indicator of whether this BucketListingRef has a Key."""
|
106
|
-
return bool(self.key)
|
107
|
-
|
108
|
-
def HasPrefix(self):
|
109
|
-
"""Return bool indicator of whether this BucketListingRef has a Prefix."""
|
110
|
-
return bool(self.prefix)
|
111
|
-
|
112
|
-
def GetKey(self):
|
113
|
-
"""Get Key form of listed URI.
|
114
|
-
|
115
|
-
Returns:
|
116
|
-
Subclass of boto.s3.key.Key.
|
117
|
-
|
118
|
-
Raises:
|
119
|
-
BucketListingRefException: for bucket-only uri.
|
120
|
-
"""
|
121
|
-
# For gsutil ls -l gs://bucket self.key will be populated from (boto)
|
122
|
-
# parsing the bucket listing. But as noted and handled below there are
|
123
|
-
# cases where self.key isn't populated.
|
124
|
-
if not self.key:
|
125
|
-
if not self.uri.names_object():
|
126
|
-
raise BucketListingRefException(
|
127
|
-
'Attempt to call GetKey() on Key-less BucketListingRef (uri=%s) ' %
|
128
|
-
self.uri)
|
129
|
-
# This case happens when we do gsutil ls -l on a object name-ful
|
130
|
-
# StorageUri with no object-name wildcard. Since the ls command
|
131
|
-
# implementation only reads bucket info we need to read the object
|
132
|
-
# for this case.
|
133
|
-
self.key = self.uri.get_key(validate=False, headers=self.headers)
|
134
|
-
# When we retrieve the object this way its last_modified timestamp
|
135
|
-
# is formatted in RFC 1123 format, which is different from when we
|
136
|
-
# retrieve from the bucket listing (which uses ISO 8601 format), so
|
137
|
-
# convert so we consistently return ISO 8601 format.
|
138
|
-
tuple_time = (time.strptime(self.key.last_modified,
|
139
|
-
'%a, %d %b %Y %H:%M:%S %Z'))
|
140
|
-
self.key.last_modified = time.strftime('%Y-%m-%dT%H:%M:%S', tuple_time)
|
141
|
-
return self.key
|
142
|
-
|
143
|
-
def GetPrefix(self):
|
144
|
-
"""Get Prefix form of listed URI.
|
145
|
-
|
146
|
-
Returns:
|
147
|
-
boto.s3.prefix.Prefix.
|
148
|
-
|
149
|
-
Raises:
|
150
|
-
BucketListingRefException: if this object has no Prefix.
|
151
|
-
"""
|
152
|
-
if not self.prefix:
|
153
|
-
raise BucketListingRefException(
|
154
|
-
'Attempt to call GetPrefix() on Prefix-less BucketListingRef '
|
155
|
-
'(uri=%s)' % self.uri)
|
156
|
-
return self.prefix
|
157
|
-
|
158
|
-
def __repr__(self):
|
159
|
-
"""Returns string representation of BucketListingRef."""
|
160
|
-
return 'BucketListingRef(%s, HasKey=%s, HasPrefix=%s)' % (
|
161
|
-
self.uri, self.HasKey(), self.HasPrefix())
|
162
|
-
|
163
|
-
|
164
|
-
class BucketListingRefException(StandardError):
|
165
|
-
"""Exception thrown for invalid BucketListingRef requests."""
|
166
|
-
|
167
|
-
def __init__(self, reason):
|
168
|
-
StandardError.__init__(self)
|
169
|
-
self.reason = reason
|
170
|
-
|
171
|
-
def __repr__(self):
|
172
|
-
return 'BucketListingRefException: %s' % self.reason
|
173
|
-
|
174
|
-
def __str__(self):
|
175
|
-
return 'BucketListingRefException: %s' % self.reason
|