libv8 8.4.255.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.gitmodules +3 -0
- data/.rspec +3 -0
- data/.travis.yml +45 -0
- data/CHANGELOG.md +111 -0
- data/Gemfile +4 -0
- data/README.md +152 -0
- data/Rakefile +125 -0
- data/appveyor.yml.disabled +36 -0
- data/ext/libv8/arch.rb +20 -0
- data/ext/libv8/builder.rb +106 -0
- data/ext/libv8/extconf.rb +7 -0
- data/ext/libv8/location.rb +89 -0
- data/ext/libv8/paths.rb +28 -0
- data/lib/libv8.rb +9 -0
- data/lib/libv8/version.rb +3 -0
- data/libv8.gemspec +30 -0
- data/scaleway.png +0 -0
- data/spec/location_spec.rb +69 -0
- data/spec/spec_helper.rb +4 -0
- data/thefrontside.png +0 -0
- data/vendor/depot_tools/.cipd_impl.ps1 +129 -0
- data/vendor/depot_tools/.gitattributes +55 -0
- data/vendor/depot_tools/.gitignore +92 -0
- data/vendor/depot_tools/.style.yapf +4 -0
- data/vendor/depot_tools/.vpython +55 -0
- data/vendor/depot_tools/.vpython3 +23 -0
- data/vendor/depot_tools/CROS_OWNERS +7 -0
- data/vendor/depot_tools/GOMA_OWNERS +9 -0
- data/vendor/depot_tools/LICENSE +27 -0
- data/vendor/depot_tools/LUCI_OWNERS +5 -0
- data/vendor/depot_tools/OWNERS +39 -0
- data/vendor/depot_tools/PRESUBMIT.py +150 -0
- data/vendor/depot_tools/README.gclient.md +67 -0
- data/vendor/depot_tools/README.git-cl.md +99 -0
- data/vendor/depot_tools/README.md +78 -0
- data/vendor/depot_tools/WATCHLISTS +26 -0
- data/vendor/depot_tools/auth.py +163 -0
- data/vendor/depot_tools/autoninja +36 -0
- data/vendor/depot_tools/autoninja.bat +33 -0
- data/vendor/depot_tools/autoninja.py +148 -0
- data/vendor/depot_tools/bb +12 -0
- data/vendor/depot_tools/bb.bat +7 -0
- data/vendor/depot_tools/bootstrap/README.md +155 -0
- data/vendor/depot_tools/bootstrap/bootstrap.py +356 -0
- data/vendor/depot_tools/bootstrap/git-bash.template.sh +12 -0
- data/vendor/depot_tools/bootstrap/git.template.bat +5 -0
- data/vendor/depot_tools/bootstrap/manifest.txt +27 -0
- data/vendor/depot_tools/bootstrap/manifest_bleeding_edge.txt +27 -0
- data/vendor/depot_tools/bootstrap/profile.d.python.sh +20 -0
- data/vendor/depot_tools/bootstrap/python27.bat +46 -0
- data/vendor/depot_tools/bootstrap/python3.bat +46 -0
- data/vendor/depot_tools/bootstrap/win_tools.bat +79 -0
- data/vendor/depot_tools/bootstrap_python3 +35 -0
- data/vendor/depot_tools/breakpad.py +12 -0
- data/vendor/depot_tools/cbuildbot +1 -0
- data/vendor/depot_tools/chrome_set_ver +1 -0
- data/vendor/depot_tools/cipd +247 -0
- data/vendor/depot_tools/cipd.bat +67 -0
- data/vendor/depot_tools/cipd_bin_setup.bat +6 -0
- data/vendor/depot_tools/cipd_bin_setup.sh +22 -0
- data/vendor/depot_tools/cipd_client_version +1 -0
- data/vendor/depot_tools/cipd_client_version.digests +22 -0
- data/vendor/depot_tools/cipd_manifest.txt +63 -0
- data/vendor/depot_tools/cipd_manifest.versions +438 -0
- data/vendor/depot_tools/cit +8 -0
- data/vendor/depot_tools/cit.bat +12 -0
- data/vendor/depot_tools/cit.py +167 -0
- data/vendor/depot_tools/clang-format +8 -0
- data/vendor/depot_tools/clang-format.bat +12 -0
- data/vendor/depot_tools/clang_format.py +79 -0
- data/vendor/depot_tools/clang_format_merge_driver +8 -0
- data/vendor/depot_tools/clang_format_merge_driver.bat +12 -0
- data/vendor/depot_tools/clang_format_merge_driver.py +69 -0
- data/vendor/depot_tools/codereview.settings +6 -0
- data/vendor/depot_tools/compile_single_file +8 -0
- data/vendor/depot_tools/compile_single_file.bat +11 -0
- data/vendor/depot_tools/compile_single_file.py +79 -0
- data/vendor/depot_tools/cpplint.bat +11 -0
- data/vendor/depot_tools/cpplint.py +6097 -0
- data/vendor/depot_tools/cpplint_chromium.py +50 -0
- data/vendor/depot_tools/cros +87 -0
- data/vendor/depot_tools/cros_sdk +1 -0
- data/vendor/depot_tools/crosjobs +13 -0
- data/vendor/depot_tools/detect_host_arch.py +55 -0
- data/vendor/depot_tools/dirmd +12 -0
- data/vendor/depot_tools/dirmd.bat +7 -0
- data/vendor/depot_tools/download_from_google_storage +8 -0
- data/vendor/depot_tools/download_from_google_storage.bat +12 -0
- data/vendor/depot_tools/download_from_google_storage.py +634 -0
- data/vendor/depot_tools/ensure_bootstrap +53 -0
- data/vendor/depot_tools/fetch +21 -0
- data/vendor/depot_tools/fetch.bat +28 -0
- data/vendor/depot_tools/fetch.py +319 -0
- data/vendor/depot_tools/fetch_configs/android.py +34 -0
- data/vendor/depot_tools/fetch_configs/android_internal.py +34 -0
- data/vendor/depot_tools/fetch_configs/breakpad.py +44 -0
- data/vendor/depot_tools/fetch_configs/chromium.py +66 -0
- data/vendor/depot_tools/fetch_configs/config_util.py +52 -0
- data/vendor/depot_tools/fetch_configs/crashpad.py +41 -0
- data/vendor/depot_tools/fetch_configs/dart.py +45 -0
- data/vendor/depot_tools/fetch_configs/depot_tools.py +44 -0
- data/vendor/depot_tools/fetch_configs/devtools-frontend.py +44 -0
- data/vendor/depot_tools/fetch_configs/goma_client.py +41 -0
- data/vendor/depot_tools/fetch_configs/gyp.py +41 -0
- data/vendor/depot_tools/fetch_configs/infra.py +40 -0
- data/vendor/depot_tools/fetch_configs/infra_internal.py +45 -0
- data/vendor/depot_tools/fetch_configs/inspector_protocol.py +40 -0
- data/vendor/depot_tools/fetch_configs/ios.py +34 -0
- data/vendor/depot_tools/fetch_configs/ios_internal.py +39 -0
- data/vendor/depot_tools/fetch_configs/nacl.py +48 -0
- data/vendor/depot_tools/fetch_configs/naclports.py +47 -0
- data/vendor/depot_tools/fetch_configs/node-ci.py +41 -0
- data/vendor/depot_tools/fetch_configs/pdfium.py +40 -0
- data/vendor/depot_tools/fetch_configs/skia.py +41 -0
- data/vendor/depot_tools/fetch_configs/skia_buildbot.py +41 -0
- data/vendor/depot_tools/fetch_configs/syzygy.py +41 -0
- data/vendor/depot_tools/fetch_configs/v8.py +44 -0
- data/vendor/depot_tools/fetch_configs/webrtc.py +52 -0
- data/vendor/depot_tools/fetch_configs/webrtc_android.py +34 -0
- data/vendor/depot_tools/fetch_configs/webrtc_ios.py +34 -0
- data/vendor/depot_tools/fix_encoding.py +385 -0
- data/vendor/depot_tools/gclient +38 -0
- data/vendor/depot_tools/gclient-new-workdir.py +124 -0
- data/vendor/depot_tools/gclient.bat +32 -0
- data/vendor/depot_tools/gclient.py +3198 -0
- data/vendor/depot_tools/gclient_completion.sh +76 -0
- data/vendor/depot_tools/gclient_eval.py +891 -0
- data/vendor/depot_tools/gclient_paths.py +152 -0
- data/vendor/depot_tools/gclient_scm.py +1615 -0
- data/vendor/depot_tools/gclient_utils.py +1280 -0
- data/vendor/depot_tools/gerrit_client.py +151 -0
- data/vendor/depot_tools/gerrit_util.py +996 -0
- data/vendor/depot_tools/git-cache +6 -0
- data/vendor/depot_tools/git-cl +6 -0
- data/vendor/depot_tools/git-crrev-parse +53 -0
- data/vendor/depot_tools/git-drover +6 -0
- data/vendor/depot_tools/git-find-releases +6 -0
- data/vendor/depot_tools/git-footers +6 -0
- data/vendor/depot_tools/git-freeze +8 -0
- data/vendor/depot_tools/git-gs +9 -0
- data/vendor/depot_tools/git-hyper-blame +6 -0
- data/vendor/depot_tools/git-map +6 -0
- data/vendor/depot_tools/git-map-branches +6 -0
- data/vendor/depot_tools/git-mark-merge-base +6 -0
- data/vendor/depot_tools/git-nav-downstream +6 -0
- data/vendor/depot_tools/git-nav-upstream +6 -0
- data/vendor/depot_tools/git-new-branch +6 -0
- data/vendor/depot_tools/git-number +6 -0
- data/vendor/depot_tools/git-rebase-update +6 -0
- data/vendor/depot_tools/git-rename-branch +6 -0
- data/vendor/depot_tools/git-reparent-branch +6 -0
- data/vendor/depot_tools/git-retry +8 -0
- data/vendor/depot_tools/git-runhooks +23 -0
- data/vendor/depot_tools/git-squash-branch +6 -0
- data/vendor/depot_tools/git-templates/description +3 -0
- data/vendor/depot_tools/git-templates/hooks/applypatch-msg +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-applypatch +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-checkout +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-commit +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-merge +4 -0
- data/vendor/depot_tools/git-templates/hooks/post-update +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-applypatch +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-auto-gc +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-commit +4 -0
- data/vendor/depot_tools/git-templates/hooks/pre-rebase +4 -0
- data/vendor/depot_tools/git-templates/hooks/prepare-commit-msg +4 -0
- data/vendor/depot_tools/git-templates/info/exclude +6 -0
- data/vendor/depot_tools/git-thaw +13 -0
- data/vendor/depot_tools/git-upstream-diff +9 -0
- data/vendor/depot_tools/git_cache.py +786 -0
- data/vendor/depot_tools/git_cl.py +5158 -0
- data/vendor/depot_tools/git_cl_completion.sh +48 -0
- data/vendor/depot_tools/git_common.py +1101 -0
- data/vendor/depot_tools/git_dates.py +62 -0
- data/vendor/depot_tools/git_drover.py +469 -0
- data/vendor/depot_tools/git_find_releases.py +67 -0
- data/vendor/depot_tools/git_footers.py +261 -0
- data/vendor/depot_tools/git_freezer.py +40 -0
- data/vendor/depot_tools/git_hyper_blame.py +391 -0
- data/vendor/depot_tools/git_map.py +166 -0
- data/vendor/depot_tools/git_map_branches.py +354 -0
- data/vendor/depot_tools/git_mark_merge_base.py +73 -0
- data/vendor/depot_tools/git_nav_downstream.py +69 -0
- data/vendor/depot_tools/git_new_branch.py +82 -0
- data/vendor/depot_tools/git_number.py +301 -0
- data/vendor/depot_tools/git_rebase_update.py +351 -0
- data/vendor/depot_tools/git_rename_branch.py +55 -0
- data/vendor/depot_tools/git_reparent_branch.py +101 -0
- data/vendor/depot_tools/git_retry.py +181 -0
- data/vendor/depot_tools/git_squash_branch.py +28 -0
- data/vendor/depot_tools/git_upstream_diff.py +64 -0
- data/vendor/depot_tools/gn +8 -0
- data/vendor/depot_tools/gn.bat +12 -0
- data/vendor/depot_tools/gn.py +78 -0
- data/vendor/depot_tools/goma_auth +12 -0
- data/vendor/depot_tools/goma_auth.bat +8 -0
- data/vendor/depot_tools/goma_ctl +12 -0
- data/vendor/depot_tools/goma_ctl.bat +8 -0
- data/vendor/depot_tools/gsutil.py +190 -0
- data/vendor/depot_tools/gsutil.py.bat +23 -0
- data/vendor/depot_tools/gsutil.vpython +120 -0
- data/vendor/depot_tools/infra/README.md +1 -0
- data/vendor/depot_tools/infra/config/OWNERS +7 -0
- data/vendor/depot_tools/infra/config/README.md +1 -0
- data/vendor/depot_tools/infra/config/recipes.cfg +26 -0
- data/vendor/depot_tools/led +12 -0
- data/vendor/depot_tools/led.bat +7 -0
- data/vendor/depot_tools/lockfile.py +116 -0
- data/vendor/depot_tools/luci-auth +13 -0
- data/vendor/depot_tools/luci-auth.bat +8 -0
- data/vendor/depot_tools/lucicfg +12 -0
- data/vendor/depot_tools/lucicfg.bat +7 -0
- data/vendor/depot_tools/mac_toolchain +12 -0
- data/vendor/depot_tools/man/html/depot_tools.html +934 -0
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +1593 -0
- data/vendor/depot_tools/man/html/git-cl.html +1033 -0
- data/vendor/depot_tools/man/html/git-drover.html +1048 -0
- data/vendor/depot_tools/man/html/git-footers.html +878 -0
- data/vendor/depot_tools/man/html/git-freeze.html +859 -0
- data/vendor/depot_tools/man/html/git-hyper-blame.html +878 -0
- data/vendor/depot_tools/man/html/git-map-branches.html +904 -0
- data/vendor/depot_tools/man/html/git-map.html +887 -0
- data/vendor/depot_tools/man/html/git-mark-merge-base.html +826 -0
- data/vendor/depot_tools/man/html/git-nav-downstream.html +844 -0
- data/vendor/depot_tools/man/html/git-nav-upstream.html +853 -0
- data/vendor/depot_tools/man/html/git-new-branch.html +932 -0
- data/vendor/depot_tools/man/html/git-rebase-update.html +961 -0
- data/vendor/depot_tools/man/html/git-rename-branch.html +794 -0
- data/vendor/depot_tools/man/html/git-reparent-branch.html +847 -0
- data/vendor/depot_tools/man/html/git-retry.html +858 -0
- data/vendor/depot_tools/man/html/git-squash-branch.html +881 -0
- data/vendor/depot_tools/man/html/git-thaw.html +794 -0
- data/vendor/depot_tools/man/html/git-upstream-diff.html +923 -0
- data/vendor/depot_tools/man/man1/git-cl.1 +198 -0
- data/vendor/depot_tools/man/man1/git-drover.1 +330 -0
- data/vendor/depot_tools/man/man1/git-footers.1 +144 -0
- data/vendor/depot_tools/man/man1/git-freeze.1 +113 -0
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +128 -0
- data/vendor/depot_tools/man/man1/git-map-branches.1 +210 -0
- data/vendor/depot_tools/man/man1/git-map.1 +179 -0
- data/vendor/depot_tools/man/man1/git-mark-merge-base.1 +69 -0
- data/vendor/depot_tools/man/man1/git-nav-downstream.1 +112 -0
- data/vendor/depot_tools/man/man1/git-nav-upstream.1 +122 -0
- data/vendor/depot_tools/man/man1/git-new-branch.1 +176 -0
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +177 -0
- data/vendor/depot_tools/man/man1/git-rename-branch.1 +53 -0
- data/vendor/depot_tools/man/man1/git-reparent-branch.1 +93 -0
- data/vendor/depot_tools/man/man1/git-retry.1 +108 -0
- data/vendor/depot_tools/man/man1/git-squash-branch.1 +129 -0
- data/vendor/depot_tools/man/man1/git-thaw.1 +54 -0
- data/vendor/depot_tools/man/man1/git-upstream-diff.1 +153 -0
- data/vendor/depot_tools/man/man7/depot_tools.7 +139 -0
- data/vendor/depot_tools/man/man7/depot_tools_tutorial.7 +1061 -0
- data/vendor/depot_tools/man/push_to_gs.sh +4 -0
- data/vendor/depot_tools/man/src/.gitignore +5 -0
- data/vendor/depot_tools/man/src/_aliases.txt +5 -0
- data/vendor/depot_tools/man/src/_footer.txt +8 -0
- data/vendor/depot_tools/man/src/_git-cl_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-drover_desc.helper.txt +2 -0
- data/vendor/depot_tools/man/src/_git-footers_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-freeze_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-hyper-blame_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-map-branches_desc.helper.txt +4 -0
- data/vendor/depot_tools/man/src/_git-map_desc.helper.txt +3 -0
- data/vendor/depot_tools/man/src/_git-mark-merge-base_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-nav-downstream_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-nav-upstream_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-new-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-rebase-update_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-rename-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-reparent-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-retry_desc.helper.txt +2 -0
- data/vendor/depot_tools/man/src/_git-squash-branch_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_git-thaw_desc.helper.txt +2 -0
- data/vendor/depot_tools/man/src/_git-upstream-diff_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/_helper_prefix.txt +1 -0
- data/vendor/depot_tools/man/src/asciidoc-override.css +7 -0
- data/vendor/depot_tools/man/src/common_demo_functions.sh +84 -0
- data/vendor/depot_tools/man/src/demo_repo.sh +43 -0
- data/vendor/depot_tools/man/src/depot_tools.txt +28 -0
- data/vendor/depot_tools/man/src/depot_tools_tutorial.demo.walkthrough.sh +155 -0
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +432 -0
- data/vendor/depot_tools/man/src/filter_demo_output.py +141 -0
- data/vendor/depot_tools/man/src/git-cl.txt +119 -0
- data/vendor/depot_tools/man/src/git-drover.demo.1.sh +22 -0
- data/vendor/depot_tools/man/src/git-drover.demo.2.sh +23 -0
- data/vendor/depot_tools/man/src/git-drover.demo.3.sh +27 -0
- data/vendor/depot_tools/man/src/git-drover.demo.4.sh +39 -0
- data/vendor/depot_tools/man/src/git-drover.demo.common.sh +19 -0
- data/vendor/depot_tools/man/src/git-drover.txt +102 -0
- data/vendor/depot_tools/man/src/git-footers.demo.1.sh +17 -0
- data/vendor/depot_tools/man/src/git-footers.txt +71 -0
- data/vendor/depot_tools/man/src/git-freeze.demo.1.sh +23 -0
- data/vendor/depot_tools/man/src/git-freeze.txt +54 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.demo.1.sh +3 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.demo.2.sh +4 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.demo.common.sh +57 -0
- data/vendor/depot_tools/man/src/git-hyper-blame.txt +85 -0
- data/vendor/depot_tools/man/src/git-map-branches.demo.1.sh +8 -0
- data/vendor/depot_tools/man/src/git-map-branches.txt +64 -0
- data/vendor/depot_tools/man/src/git-map.demo.1.sh +3 -0
- data/vendor/depot_tools/man/src/git-map.txt +67 -0
- data/vendor/depot_tools/man/src/git-mark-merge-base.txt +46 -0
- data/vendor/depot_tools/man/src/git-nav-downstream.demo.1.sh +12 -0
- data/vendor/depot_tools/man/src/git-nav-downstream.txt +40 -0
- data/vendor/depot_tools/man/src/git-nav-upstream.demo.1.sh +12 -0
- data/vendor/depot_tools/man/src/git-nav-upstream.txt +39 -0
- data/vendor/depot_tools/man/src/git-new-branch.demo.1.sh +17 -0
- data/vendor/depot_tools/man/src/git-new-branch.txt +82 -0
- data/vendor/depot_tools/man/src/git-rebase-update.txt +141 -0
- data/vendor/depot_tools/man/src/git-rename-branch.txt +28 -0
- data/vendor/depot_tools/man/src/git-reparent-branch.txt +61 -0
- data/vendor/depot_tools/man/src/git-retry.txt +67 -0
- data/vendor/depot_tools/man/src/git-squash-branch.demo.1.sh +12 -0
- data/vendor/depot_tools/man/src/git-squash-branch.txt +59 -0
- data/vendor/depot_tools/man/src/git-thaw.txt +29 -0
- data/vendor/depot_tools/man/src/git-upstream-diff.txt +107 -0
- data/vendor/depot_tools/man/src/make_docs.sh +260 -0
- data/vendor/depot_tools/man/src/prep_demo_repo.sh +103 -0
- data/vendor/depot_tools/metrics.README.md +101 -0
- data/vendor/depot_tools/metrics.py +297 -0
- data/vendor/depot_tools/metrics_utils.py +293 -0
- data/vendor/depot_tools/my_activity.py +971 -0
- data/vendor/depot_tools/ninja +44 -0
- 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/ninjalog.README.md +64 -0
- data/vendor/depot_tools/ninjalog_uploader.py +233 -0
- data/vendor/depot_tools/ninjalog_uploader_wrapper.py +125 -0
- data/vendor/depot_tools/owners.py +641 -0
- data/vendor/depot_tools/owners_finder.py +385 -0
- data/vendor/depot_tools/post_build_ninja_summary.py +350 -0
- data/vendor/depot_tools/presubmit_canned_checks.py +1655 -0
- data/vendor/depot_tools/presubmit_support.py +1923 -0
- data/vendor/depot_tools/profile.xml +8 -0
- data/vendor/depot_tools/prpc +13 -0
- data/vendor/depot_tools/prpc.bat +8 -0
- data/vendor/depot_tools/pylint +9 -0
- data/vendor/depot_tools/pylint-1.5 +78 -0
- data/vendor/depot_tools/pylint-1.6 +78 -0
- data/vendor/depot_tools/pylint-1.7 +78 -0
- data/vendor/depot_tools/pylint-1.8 +78 -0
- data/vendor/depot_tools/pylint-1.9 +78 -0
- data/vendor/depot_tools/pylint.bat +12 -0
- data/vendor/depot_tools/pylint_main.py +45 -0
- data/vendor/depot_tools/pylintrc +349 -0
- data/vendor/depot_tools/python-bin/python3 +7 -0
- data/vendor/depot_tools/python_runner.sh +60 -0
- data/vendor/depot_tools/rdb +12 -0
- data/vendor/depot_tools/rdb.bat +7 -0
- data/vendor/depot_tools/recipes/OWNERS +4 -0
- data/vendor/depot_tools/recipes/README.recipes.md +1079 -0
- data/vendor/depot_tools/recipes/recipe_modules/OWNERS +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/OWNERS +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +38 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +516 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +118 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +194 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/input_commit_with_id_without_repo.json +210 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/multiple_patch_refs.json +214 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_HEAD.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_branch_head.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_a_specific_commit.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_cp_checkout_master.json +65 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/refs.json +212 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +210 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/resolve_chromium_fixed_version.json +117 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +209 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +193 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +261 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +261 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +8 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +211 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +308 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/__init__.py +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +1258 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +93 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/do_not_retry_patch_failures_in_cq.py +42 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +35 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/__init__.py +9 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +455 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +82 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +411 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +315 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +313 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +313 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +403 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.py +187 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py +59 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/test_api.py +93 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/__init__.py +9 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +75 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.py +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +13 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +428 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +462 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +238 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +240 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +238 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/resources/diff_deps.py +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/test_api.py +36 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/basic.json +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/dont have revision yet.json +84 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/no change, exception.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.expected/windows.json +55 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/diff_deps.py +88 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +92 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/sync_failure.py +24 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/__init__.py +8 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +178 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +284 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +73 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/test_api.py +53 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +11 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/api.py +405 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +219 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +216 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +164 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +220 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +239 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +290 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +220 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +222 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +111 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +265 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +217 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +221 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +219 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +218 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +170 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/resources/git_setup.py +52 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/test_api.py +18 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/__init__.py +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +50 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/config.py +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +105 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.py +47 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/OWNERS +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/__init__.py +12 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +257 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +596 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.py +93 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +251 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/test_api.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/__init__.py +4 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +222 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +247 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.py +92 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/resources/gsutil_smart_retry.py +69 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +36 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +140 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/ancient_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/automatic_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/explicit_version.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +83 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +42 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +27 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +251 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +27 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.py +19 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/properties.proto +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/test_api.py +19 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/execute.py +247 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/tests/prepare.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +18 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +264 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +57 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +190 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +190 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/test_api.py +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py +29 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.expected/basic.json +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py +32 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/__init__.py +25 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/api.py +137 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +21 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +108 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +21 -0
- data/vendor/depot_tools/recipes/recipes.py +249 -0
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +175 -0
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.py +56 -0
- data/vendor/depot_tools/recipes/trigger_recipe_roller.txt +13 -0
- data/vendor/depot_tools/repo +1194 -0
- data/vendor/depot_tools/roll-dep +21 -0
- data/vendor/depot_tools/roll-dep.bat +21 -0
- data/vendor/depot_tools/roll_dep.py +282 -0
- data/vendor/depot_tools/scm.py +415 -0
- data/vendor/depot_tools/setup_color.py +130 -0
- data/vendor/depot_tools/split_cl.py +263 -0
- data/vendor/depot_tools/subcommand.py +261 -0
- data/vendor/depot_tools/subprocess2.py +258 -0
- data/vendor/depot_tools/third_party/__init__.py +5 -0
- data/vendor/depot_tools/third_party/colorama/LICENSE.txt +27 -0
- data/vendor/depot_tools/third_party/colorama/README.chromium +12 -0
- data/vendor/depot_tools/third_party/colorama/README.rst +346 -0
- data/vendor/depot_tools/third_party/colorama/__init__.py +6 -0
- data/vendor/depot_tools/third_party/colorama/ansi.py +102 -0
- data/vendor/depot_tools/third_party/colorama/ansitowin32.py +257 -0
- data/vendor/depot_tools/third_party/colorama/initialise.py +80 -0
- data/vendor/depot_tools/third_party/colorama/win32.py +152 -0
- data/vendor/depot_tools/third_party/colorama/winterm.py +169 -0
- data/vendor/depot_tools/third_party/coverage/AUTHORS.txt +43 -0
- data/vendor/depot_tools/third_party/coverage/PKG-INFO +41 -0
- data/vendor/depot_tools/third_party/coverage/README.chromium +13 -0
- data/vendor/depot_tools/third_party/coverage/__init__.py +120 -0
- data/vendor/depot_tools/third_party/coverage/__main__.py +4 -0
- data/vendor/depot_tools/third_party/coverage/annotate.py +101 -0
- data/vendor/depot_tools/third_party/coverage/backward.py +184 -0
- data/vendor/depot_tools/third_party/coverage/bytecode.py +75 -0
- data/vendor/depot_tools/third_party/coverage/cmdline.py +740 -0
- data/vendor/depot_tools/third_party/coverage/codeunit.py +145 -0
- data/vendor/depot_tools/third_party/coverage/collector.py +353 -0
- data/vendor/depot_tools/third_party/coverage/config.py +213 -0
- data/vendor/depot_tools/third_party/coverage/control.py +776 -0
- data/vendor/depot_tools/third_party/coverage/data.py +278 -0
- data/vendor/depot_tools/third_party/coverage/debug.py +54 -0
- data/vendor/depot_tools/third_party/coverage/execfile.py +171 -0
- data/vendor/depot_tools/third_party/coverage/files.py +309 -0
- data/vendor/depot_tools/third_party/coverage/fullcoverage/encodings.py +57 -0
- data/vendor/depot_tools/third_party/coverage/html.py +387 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/coverage_html.js +376 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/index.html +104 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery-1.4.3.min.js +166 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.hotkeys.js +99 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.isonscreen.js +53 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.min.js +166 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/jquery.tablesorter.min.js +2 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/keybd_closed.png +0 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/keybd_open.png +0 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/pyfile.html +90 -0
- data/vendor/depot_tools/third_party/coverage/htmlfiles/style.css +300 -0
- data/vendor/depot_tools/third_party/coverage/misc.py +163 -0
- data/vendor/depot_tools/third_party/coverage/parser.py +666 -0
- data/vendor/depot_tools/third_party/coverage/phystokens.py +208 -0
- data/vendor/depot_tools/third_party/coverage/report.py +92 -0
- data/vendor/depot_tools/third_party/coverage/results.py +286 -0
- data/vendor/depot_tools/third_party/coverage/summary.py +86 -0
- data/vendor/depot_tools/third_party/coverage/templite.py +166 -0
- data/vendor/depot_tools/third_party/coverage/version.py +9 -0
- data/vendor/depot_tools/third_party/coverage/xmlreport.py +155 -0
- data/vendor/depot_tools/third_party/httplib2/LICENSE +1339 -0
- data/vendor/depot_tools/third_party/httplib2/README.chromium +15 -0
- data/vendor/depot_tools/third_party/httplib2/__init__.py +1780 -0
- data/vendor/depot_tools/third_party/httplib2/cacerts.txt +2196 -0
- data/vendor/depot_tools/third_party/httplib2/iri2uri.py +110 -0
- data/vendor/depot_tools/third_party/httplib2/socks.py +448 -0
- data/vendor/depot_tools/third_party/repo/COPYING +202 -0
- data/vendor/depot_tools/third_party/repo/README.chromium +4 -0
- data/vendor/depot_tools/third_party/repo/__init__.py +0 -0
- data/vendor/depot_tools/third_party/repo/progress.py +117 -0
- data/vendor/depot_tools/third_party/retry_decorator/LICENSE.google +30 -0
- data/vendor/depot_tools/third_party/retry_decorator/__init__.py +0 -0
- data/vendor/depot_tools/third_party/retry_decorator/decorators.py +45 -0
- data/vendor/depot_tools/third_party/schema/.editorconfig +15 -0
- data/vendor/depot_tools/third_party/schema/.gitignore +174 -0
- data/vendor/depot_tools/third_party/schema/.travis.yml +37 -0
- data/vendor/depot_tools/third_party/schema/LICENSE-MIT +19 -0
- data/vendor/depot_tools/third_party/schema/MANIFEST.in +1 -0
- data/vendor/depot_tools/third_party/schema/README.chromium +12 -0
- data/vendor/depot_tools/third_party/schema/README.rst +382 -0
- data/vendor/depot_tools/third_party/schema/__init__.py +1 -0
- data/vendor/depot_tools/third_party/schema/schema.py +338 -0
- data/vendor/depot_tools/third_party/schema/setup.cfg +5 -0
- data/vendor/depot_tools/third_party/schema/setup.py +30 -0
- data/vendor/depot_tools/third_party/schema/test_schema.py +556 -0
- data/vendor/depot_tools/third_party/schema/tox.ini +33 -0
- data/vendor/depot_tools/third_party/six/LICENSE.txt +18 -0
- data/vendor/depot_tools/third_party/six/README.chromium +10 -0
- data/vendor/depot_tools/third_party/six/__init__.py +762 -0
- data/vendor/depot_tools/update_depot_tools +138 -0
- data/vendor/depot_tools/update_depot_tools.bat +65 -0
- data/vendor/depot_tools/update_depot_tools_toggle.py +38 -0
- data/vendor/depot_tools/upload_metrics.py +26 -0
- data/vendor/depot_tools/upload_to_google_storage.py +306 -0
- data/vendor/depot_tools/vpython +42 -0
- data/vendor/depot_tools/vpython.bat +7 -0
- data/vendor/depot_tools/vpython3 +55 -0
- data/vendor/depot_tools/vpython3.bat +12 -0
- data/vendor/depot_tools/watchlists.py +141 -0
- data/vendor/depot_tools/weekly +54 -0
- data/vendor/depot_tools/win32imports.py +61 -0
- data/vendor/depot_tools/win_toolchain/OWNERS +2 -0
- data/vendor/depot_tools/win_toolchain/README.md +74 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +599 -0
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +524 -0
- data/vendor/depot_tools/wtf +81 -0
- data/vendor/depot_tools/yapf +21 -0
- data/vendor/depot_tools/yapf.bat +12 -0
- data/vendor/depot_tools/zsh-goodies/README +6 -0
- data/vendor/depot_tools/zsh-goodies/_gclient +14 -0
- metadata +729 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# gclient_completion.sh
|
|
2
|
+
#
|
|
3
|
+
# This adds completion to bash shells for gclient commands. It is
|
|
4
|
+
# meant for developers and not needed for inclusion by any automated
|
|
5
|
+
# processes that will, of course, specify the full command, not rely
|
|
6
|
+
# on or benefit from tab-completion.
|
|
7
|
+
#
|
|
8
|
+
# Requires:
|
|
9
|
+
# bash-completion package for _get_comp_words_by_ref.
|
|
10
|
+
# newer versions of sed for the improved regular expression handling.
|
|
11
|
+
#
|
|
12
|
+
# On Mac, this is accomplished by installing fink (www.finkproject.org)
|
|
13
|
+
# then doing sudo apt-get update ; sudo apt-get install sed
|
|
14
|
+
#
|
|
15
|
+
# Usage:
|
|
16
|
+
# Put something like the following in your .bashrc:
|
|
17
|
+
# . $PATH_TO_DEPOT_TOOLS/gclient_completion.sh
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Parses commands from gclient -h.
|
|
22
|
+
__gclient_commands () {
|
|
23
|
+
gclient -h 2> /dev/null | sed -n 's/^\s*\x1b\[32m\(.*\)\x1b\[39m.*$/\1/p'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# Caches variables in __gclient_all_commands.
|
|
27
|
+
# Adds "update" command, which is not listed.
|
|
28
|
+
__gclient_compute_all_commands () {
|
|
29
|
+
test -n "$__gclient_all_commands" ||
|
|
30
|
+
__gclient_all_commands="$(__gclient_commands) update"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Since gclient fetch is a passthrough to git, let the completions
|
|
34
|
+
# come from git's completion if it's defined.
|
|
35
|
+
if [[ -n _git_fetch ]]; then
|
|
36
|
+
_gclient_fetch=_git_fetch
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Completion callback for gclient cmdlines.
|
|
40
|
+
_gclient () {
|
|
41
|
+
local cur prev words cword
|
|
42
|
+
_get_comp_words_by_ref -n =: cur prev words cword
|
|
43
|
+
|
|
44
|
+
# Find the command by ignoring flags.
|
|
45
|
+
local i c=1 cword_adjust=0 command
|
|
46
|
+
while [ $c -lt $cword ]; do
|
|
47
|
+
i="${words[$c]}"
|
|
48
|
+
case "$i" in
|
|
49
|
+
-*)
|
|
50
|
+
((cword_adjust++))
|
|
51
|
+
: ignore options ;;
|
|
52
|
+
*) command="$i"; break ;;
|
|
53
|
+
esac
|
|
54
|
+
((c++))
|
|
55
|
+
done
|
|
56
|
+
|
|
57
|
+
# If there is a completion function for the command, use it and
|
|
58
|
+
# return.
|
|
59
|
+
local completion_func="_gclient_${command//-/_}"
|
|
60
|
+
local -f $completion_func >/dev/null && $completion_func && return
|
|
61
|
+
|
|
62
|
+
# If the command or hasn't been given, provide completions for all
|
|
63
|
+
# commands. Also provide all commands as completion for the help
|
|
64
|
+
# command.
|
|
65
|
+
# echo "command=$command" >> /tmp/comp.log
|
|
66
|
+
case "$command" in
|
|
67
|
+
""|help)
|
|
68
|
+
if [[ "$command" != help || $((cword - cword_adjust)) -le 2 ]]; then
|
|
69
|
+
__gclient_compute_all_commands
|
|
70
|
+
COMPREPLY=($(compgen -W "$__gclient_all_commands" $cur))
|
|
71
|
+
fi
|
|
72
|
+
;;
|
|
73
|
+
*) : just use the default ;;
|
|
74
|
+
esac
|
|
75
|
+
} &&
|
|
76
|
+
complete -F _gclient -o default gclient
|
|
@@ -0,0 +1,891 @@
|
|
|
1
|
+
# Copyright 2017 The Chromium Authors. All rights reserved.
|
|
2
|
+
# Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
# found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import ast
|
|
6
|
+
import collections
|
|
7
|
+
import logging
|
|
8
|
+
import sys
|
|
9
|
+
import tokenize
|
|
10
|
+
|
|
11
|
+
import gclient_utils
|
|
12
|
+
|
|
13
|
+
from third_party import schema
|
|
14
|
+
from third_party import six
|
|
15
|
+
|
|
16
|
+
if six.PY2:
|
|
17
|
+
# We use cStringIO.StringIO because it is equivalent to Py3's io.StringIO.
|
|
18
|
+
from cStringIO import StringIO
|
|
19
|
+
import collections as collections_abc
|
|
20
|
+
else:
|
|
21
|
+
from collections import abc as collections_abc
|
|
22
|
+
from io import StringIO
|
|
23
|
+
# pylint: disable=redefined-builtin
|
|
24
|
+
basestring = str
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ConstantString(object):
|
|
28
|
+
def __init__(self, value):
|
|
29
|
+
self.value = value
|
|
30
|
+
|
|
31
|
+
def __format__(self, format_spec):
|
|
32
|
+
del format_spec
|
|
33
|
+
return self.value
|
|
34
|
+
|
|
35
|
+
def __repr__(self):
|
|
36
|
+
return "Str('" + self.value + "')"
|
|
37
|
+
|
|
38
|
+
def __eq__(self, other):
|
|
39
|
+
if isinstance(other, ConstantString):
|
|
40
|
+
return self.value == other.value
|
|
41
|
+
else:
|
|
42
|
+
return self.value == other
|
|
43
|
+
|
|
44
|
+
def __hash__(self):
|
|
45
|
+
return self.value.__hash__()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class _NodeDict(collections_abc.MutableMapping):
|
|
49
|
+
"""Dict-like type that also stores information on AST nodes and tokens."""
|
|
50
|
+
def __init__(self, data=None, tokens=None):
|
|
51
|
+
self.data = collections.OrderedDict(data or [])
|
|
52
|
+
self.tokens = tokens
|
|
53
|
+
|
|
54
|
+
def __str__(self):
|
|
55
|
+
return str({k: v[0] for k, v in self.data.items()})
|
|
56
|
+
|
|
57
|
+
def __repr__(self):
|
|
58
|
+
return self.__str__()
|
|
59
|
+
|
|
60
|
+
def __getitem__(self, key):
|
|
61
|
+
return self.data[key][0]
|
|
62
|
+
|
|
63
|
+
def __setitem__(self, key, value):
|
|
64
|
+
self.data[key] = (value, None)
|
|
65
|
+
|
|
66
|
+
def __delitem__(self, key):
|
|
67
|
+
del self.data[key]
|
|
68
|
+
|
|
69
|
+
def __iter__(self):
|
|
70
|
+
return iter(self.data)
|
|
71
|
+
|
|
72
|
+
def __len__(self):
|
|
73
|
+
return len(self.data)
|
|
74
|
+
|
|
75
|
+
def MoveTokens(self, origin, delta):
|
|
76
|
+
if self.tokens:
|
|
77
|
+
new_tokens = {}
|
|
78
|
+
for pos, token in self.tokens.items():
|
|
79
|
+
if pos[0] >= origin:
|
|
80
|
+
pos = (pos[0] + delta, pos[1])
|
|
81
|
+
token = token[:2] + (pos,) + token[3:]
|
|
82
|
+
new_tokens[pos] = token
|
|
83
|
+
|
|
84
|
+
for value, node in self.data.values():
|
|
85
|
+
if node.lineno >= origin:
|
|
86
|
+
node.lineno += delta
|
|
87
|
+
if isinstance(value, _NodeDict):
|
|
88
|
+
value.MoveTokens(origin, delta)
|
|
89
|
+
|
|
90
|
+
def GetNode(self, key):
|
|
91
|
+
return self.data[key][1]
|
|
92
|
+
|
|
93
|
+
def SetNode(self, key, value, node):
|
|
94
|
+
self.data[key] = (value, node)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _NodeDictSchema(dict_schema):
|
|
98
|
+
"""Validate dict_schema after converting _NodeDict to a regular dict."""
|
|
99
|
+
def validate(d):
|
|
100
|
+
schema.Schema(dict_schema).validate(dict(d))
|
|
101
|
+
return True
|
|
102
|
+
return validate
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# See https://github.com/keleshev/schema for docs how to configure schema.
|
|
106
|
+
_GCLIENT_DEPS_SCHEMA = _NodeDictSchema({
|
|
107
|
+
schema.Optional(basestring):
|
|
108
|
+
schema.Or(
|
|
109
|
+
None,
|
|
110
|
+
basestring,
|
|
111
|
+
_NodeDictSchema({
|
|
112
|
+
# Repo and revision to check out under the path
|
|
113
|
+
# (same as if no dict was used).
|
|
114
|
+
'url': schema.Or(None, basestring),
|
|
115
|
+
|
|
116
|
+
# Optional condition string. The dep will only be processed
|
|
117
|
+
# if the condition evaluates to True.
|
|
118
|
+
schema.Optional('condition'): basestring,
|
|
119
|
+
schema.Optional('dep_type', default='git'): basestring,
|
|
120
|
+
}),
|
|
121
|
+
# CIPD package.
|
|
122
|
+
_NodeDictSchema({
|
|
123
|
+
'packages': [
|
|
124
|
+
_NodeDictSchema({
|
|
125
|
+
'package': basestring,
|
|
126
|
+
'version': basestring,
|
|
127
|
+
})
|
|
128
|
+
],
|
|
129
|
+
schema.Optional('condition'): basestring,
|
|
130
|
+
schema.Optional('dep_type', default='cipd'): basestring,
|
|
131
|
+
}),
|
|
132
|
+
),
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
_GCLIENT_HOOKS_SCHEMA = [
|
|
136
|
+
_NodeDictSchema({
|
|
137
|
+
# Hook action: list of command-line arguments to invoke.
|
|
138
|
+
'action': [schema.Or(basestring)],
|
|
139
|
+
|
|
140
|
+
# Name of the hook. Doesn't affect operation.
|
|
141
|
+
schema.Optional('name'): basestring,
|
|
142
|
+
|
|
143
|
+
# Hook pattern (regex). Originally intended to limit some hooks to run
|
|
144
|
+
# only when files matching the pattern have changed. In practice, with
|
|
145
|
+
# git, gclient runs all the hooks regardless of this field.
|
|
146
|
+
schema.Optional('pattern'): basestring,
|
|
147
|
+
|
|
148
|
+
# Working directory where to execute the hook.
|
|
149
|
+
schema.Optional('cwd'): basestring,
|
|
150
|
+
|
|
151
|
+
# Optional condition string. The hook will only be run
|
|
152
|
+
# if the condition evaluates to True.
|
|
153
|
+
schema.Optional('condition'): basestring,
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
_GCLIENT_SCHEMA = schema.Schema(
|
|
158
|
+
_NodeDictSchema({
|
|
159
|
+
# List of host names from which dependencies are allowed (allowlist).
|
|
160
|
+
# NOTE: when not present, all hosts are allowed.
|
|
161
|
+
# NOTE: scoped to current DEPS file, not recursive.
|
|
162
|
+
schema.Optional('allowed_hosts'): [schema.Optional(basestring)],
|
|
163
|
+
|
|
164
|
+
# Mapping from paths to repo and revision to check out under that path.
|
|
165
|
+
# Applying this mapping to the on-disk checkout is the main purpose
|
|
166
|
+
# of gclient, and also why the config file is called DEPS.
|
|
167
|
+
#
|
|
168
|
+
# The following functions are allowed:
|
|
169
|
+
#
|
|
170
|
+
# Var(): allows variable substitution (either from 'vars' dict below,
|
|
171
|
+
# or command-line override)
|
|
172
|
+
schema.Optional('deps'): _GCLIENT_DEPS_SCHEMA,
|
|
173
|
+
|
|
174
|
+
# Similar to 'deps' (see above) - also keyed by OS (e.g. 'linux').
|
|
175
|
+
# Also see 'target_os'.
|
|
176
|
+
schema.Optional('deps_os'): _NodeDictSchema({
|
|
177
|
+
schema.Optional(basestring): _GCLIENT_DEPS_SCHEMA,
|
|
178
|
+
}),
|
|
179
|
+
|
|
180
|
+
# Dependency to get gclient_gn_args* settings from. This allows these
|
|
181
|
+
# values to be set in a recursedeps file, rather than requiring that
|
|
182
|
+
# they exist in the top-level solution.
|
|
183
|
+
schema.Optional('gclient_gn_args_from'): basestring,
|
|
184
|
+
|
|
185
|
+
# Path to GN args file to write selected variables.
|
|
186
|
+
schema.Optional('gclient_gn_args_file'): basestring,
|
|
187
|
+
|
|
188
|
+
# Subset of variables to write to the GN args file (see above).
|
|
189
|
+
schema.Optional('gclient_gn_args'): [schema.Optional(basestring)],
|
|
190
|
+
|
|
191
|
+
# Hooks executed after gclient sync (unless suppressed), or explicitly
|
|
192
|
+
# on gclient hooks. See _GCLIENT_HOOKS_SCHEMA for details.
|
|
193
|
+
# Also see 'pre_deps_hooks'.
|
|
194
|
+
schema.Optional('hooks'): _GCLIENT_HOOKS_SCHEMA,
|
|
195
|
+
|
|
196
|
+
# Similar to 'hooks', also keyed by OS.
|
|
197
|
+
schema.Optional('hooks_os'): _NodeDictSchema({
|
|
198
|
+
schema.Optional(basestring): _GCLIENT_HOOKS_SCHEMA
|
|
199
|
+
}),
|
|
200
|
+
|
|
201
|
+
# Rules which #includes are allowed in the directory.
|
|
202
|
+
# Also see 'skip_child_includes' and 'specific_include_rules'.
|
|
203
|
+
schema.Optional('include_rules'): [schema.Optional(basestring)],
|
|
204
|
+
|
|
205
|
+
# Hooks executed before processing DEPS. See 'hooks' for more details.
|
|
206
|
+
schema.Optional('pre_deps_hooks'): _GCLIENT_HOOKS_SCHEMA,
|
|
207
|
+
|
|
208
|
+
# Recursion limit for nested DEPS.
|
|
209
|
+
schema.Optional('recursion'): int,
|
|
210
|
+
|
|
211
|
+
# Allowlists deps for which recursion should be enabled.
|
|
212
|
+
schema.Optional('recursedeps'): [
|
|
213
|
+
schema.Optional(schema.Or(
|
|
214
|
+
basestring,
|
|
215
|
+
(basestring, basestring),
|
|
216
|
+
[basestring, basestring]
|
|
217
|
+
)),
|
|
218
|
+
],
|
|
219
|
+
|
|
220
|
+
# Blocklists directories for checking 'include_rules'.
|
|
221
|
+
schema.Optional('skip_child_includes'): [schema.Optional(basestring)],
|
|
222
|
+
|
|
223
|
+
# Mapping from paths to include rules specific for that path.
|
|
224
|
+
# See 'include_rules' for more details.
|
|
225
|
+
schema.Optional('specific_include_rules'): _NodeDictSchema({
|
|
226
|
+
schema.Optional(basestring): [basestring]
|
|
227
|
+
}),
|
|
228
|
+
|
|
229
|
+
# List of additional OS names to consider when selecting dependencies
|
|
230
|
+
# from deps_os.
|
|
231
|
+
schema.Optional('target_os'): [schema.Optional(basestring)],
|
|
232
|
+
|
|
233
|
+
# For recursed-upon sub-dependencies, check out their own dependencies
|
|
234
|
+
# relative to the parent's path, rather than relative to the .gclient
|
|
235
|
+
# file.
|
|
236
|
+
schema.Optional('use_relative_paths'): bool,
|
|
237
|
+
|
|
238
|
+
# For recursed-upon sub-dependencies, run their hooks relative to the
|
|
239
|
+
# parent's path instead of relative to the .gclient file.
|
|
240
|
+
schema.Optional('use_relative_hooks'): bool,
|
|
241
|
+
|
|
242
|
+
# Variables that can be referenced using Var() - see 'deps'.
|
|
243
|
+
schema.Optional('vars'): _NodeDictSchema({
|
|
244
|
+
schema.Optional(basestring): schema.Or(ConstantString,
|
|
245
|
+
basestring,
|
|
246
|
+
bool),
|
|
247
|
+
}),
|
|
248
|
+
}))
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def _gclient_eval(node_or_string, filename='<unknown>', vars_dict=None):
|
|
252
|
+
"""Safely evaluates a single expression. Returns the result."""
|
|
253
|
+
_allowed_names = {'None': None, 'True': True, 'False': False}
|
|
254
|
+
if isinstance(node_or_string, ConstantString):
|
|
255
|
+
return node_or_string.value
|
|
256
|
+
if isinstance(node_or_string, basestring):
|
|
257
|
+
node_or_string = ast.parse(node_or_string, filename=filename, mode='eval')
|
|
258
|
+
if isinstance(node_or_string, ast.Expression):
|
|
259
|
+
node_or_string = node_or_string.body
|
|
260
|
+
def _convert(node):
|
|
261
|
+
if isinstance(node, ast.Str):
|
|
262
|
+
if vars_dict is None:
|
|
263
|
+
return node.s
|
|
264
|
+
try:
|
|
265
|
+
return node.s.format(**vars_dict)
|
|
266
|
+
except KeyError as e:
|
|
267
|
+
raise KeyError(
|
|
268
|
+
'%s was used as a variable, but was not declared in the vars dict '
|
|
269
|
+
'(file %r, line %s)' % (
|
|
270
|
+
e.args[0], filename, getattr(node, 'lineno', '<unknown>')))
|
|
271
|
+
elif isinstance(node, ast.Num):
|
|
272
|
+
return node.n
|
|
273
|
+
elif isinstance(node, ast.Tuple):
|
|
274
|
+
return tuple(map(_convert, node.elts))
|
|
275
|
+
elif isinstance(node, ast.List):
|
|
276
|
+
return list(map(_convert, node.elts))
|
|
277
|
+
elif isinstance(node, ast.Dict):
|
|
278
|
+
node_dict = _NodeDict()
|
|
279
|
+
for key_node, value_node in zip(node.keys, node.values):
|
|
280
|
+
key = _convert(key_node)
|
|
281
|
+
if key in node_dict:
|
|
282
|
+
raise ValueError(
|
|
283
|
+
'duplicate key in dictionary: %s (file %r, line %s)' % (
|
|
284
|
+
key, filename, getattr(key_node, 'lineno', '<unknown>')))
|
|
285
|
+
node_dict.SetNode(key, _convert(value_node), value_node)
|
|
286
|
+
return node_dict
|
|
287
|
+
elif isinstance(node, ast.Name):
|
|
288
|
+
if node.id not in _allowed_names:
|
|
289
|
+
raise ValueError(
|
|
290
|
+
'invalid name %r (file %r, line %s)' % (
|
|
291
|
+
node.id, filename, getattr(node, 'lineno', '<unknown>')))
|
|
292
|
+
return _allowed_names[node.id]
|
|
293
|
+
elif not sys.version_info[:2] < (3, 4) and isinstance(
|
|
294
|
+
node, ast.NameConstant): # Since Python 3.4
|
|
295
|
+
return node.value
|
|
296
|
+
elif isinstance(node, ast.Call):
|
|
297
|
+
if (not isinstance(node.func, ast.Name) or
|
|
298
|
+
(node.func.id not in ('Str', 'Var'))):
|
|
299
|
+
raise ValueError(
|
|
300
|
+
'Str and Var are the only allowed functions (file %r, line %s)' % (
|
|
301
|
+
filename, getattr(node, 'lineno', '<unknown>')))
|
|
302
|
+
if node.keywords or getattr(node, 'starargs', None) or getattr(
|
|
303
|
+
node, 'kwargs', None) or len(node.args) != 1:
|
|
304
|
+
raise ValueError(
|
|
305
|
+
'%s takes exactly one argument (file %r, line %s)' % (
|
|
306
|
+
node.func.id, filename, getattr(node, 'lineno', '<unknown>')))
|
|
307
|
+
if node.func.id == 'Str':
|
|
308
|
+
if isinstance(node.args[0], ast.Str):
|
|
309
|
+
return ConstantString(node.args[0].s)
|
|
310
|
+
raise ValueError('Passed a non-string to Str() (file %r, line%s)' % (
|
|
311
|
+
filename, getattr(node, 'lineno', '<unknown>')))
|
|
312
|
+
else:
|
|
313
|
+
arg = _convert(node.args[0])
|
|
314
|
+
if not isinstance(arg, basestring):
|
|
315
|
+
raise ValueError(
|
|
316
|
+
'Var\'s argument must be a variable name (file %r, line %s)' % (
|
|
317
|
+
filename, getattr(node, 'lineno', '<unknown>')))
|
|
318
|
+
if vars_dict is None:
|
|
319
|
+
return '{' + arg + '}'
|
|
320
|
+
if arg not in vars_dict:
|
|
321
|
+
raise KeyError(
|
|
322
|
+
'%s was used as a variable, but was not declared in the vars dict '
|
|
323
|
+
'(file %r, line %s)' % (
|
|
324
|
+
arg, filename, getattr(node, 'lineno', '<unknown>')))
|
|
325
|
+
val = vars_dict[arg]
|
|
326
|
+
if isinstance(val, ConstantString):
|
|
327
|
+
val = val.value
|
|
328
|
+
return val
|
|
329
|
+
elif isinstance(node, ast.BinOp) and isinstance(node.op, ast.Add):
|
|
330
|
+
return _convert(node.left) + _convert(node.right)
|
|
331
|
+
elif isinstance(node, ast.BinOp) and isinstance(node.op, ast.Mod):
|
|
332
|
+
return _convert(node.left) % _convert(node.right)
|
|
333
|
+
else:
|
|
334
|
+
raise ValueError(
|
|
335
|
+
'unexpected AST node: %s %s (file %r, line %s)' % (
|
|
336
|
+
node, ast.dump(node), filename,
|
|
337
|
+
getattr(node, 'lineno', '<unknown>')))
|
|
338
|
+
return _convert(node_or_string)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
def Exec(content, filename='<unknown>', vars_override=None, builtin_vars=None):
|
|
342
|
+
"""Safely execs a set of assignments."""
|
|
343
|
+
def _validate_statement(node, local_scope):
|
|
344
|
+
if not isinstance(node, ast.Assign):
|
|
345
|
+
raise ValueError(
|
|
346
|
+
'unexpected AST node: %s %s (file %r, line %s)' % (
|
|
347
|
+
node, ast.dump(node), filename,
|
|
348
|
+
getattr(node, 'lineno', '<unknown>')))
|
|
349
|
+
|
|
350
|
+
if len(node.targets) != 1:
|
|
351
|
+
raise ValueError(
|
|
352
|
+
'invalid assignment: use exactly one target (file %r, line %s)' % (
|
|
353
|
+
filename, getattr(node, 'lineno', '<unknown>')))
|
|
354
|
+
|
|
355
|
+
target = node.targets[0]
|
|
356
|
+
if not isinstance(target, ast.Name):
|
|
357
|
+
raise ValueError(
|
|
358
|
+
'invalid assignment: target should be a name (file %r, line %s)' % (
|
|
359
|
+
filename, getattr(node, 'lineno', '<unknown>')))
|
|
360
|
+
if target.id in local_scope:
|
|
361
|
+
raise ValueError(
|
|
362
|
+
'invalid assignment: overrides var %r (file %r, line %s)' % (
|
|
363
|
+
target.id, filename, getattr(node, 'lineno', '<unknown>')))
|
|
364
|
+
|
|
365
|
+
node_or_string = ast.parse(content, filename=filename, mode='exec')
|
|
366
|
+
if isinstance(node_or_string, ast.Expression):
|
|
367
|
+
node_or_string = node_or_string.body
|
|
368
|
+
|
|
369
|
+
if not isinstance(node_or_string, ast.Module):
|
|
370
|
+
raise ValueError(
|
|
371
|
+
'unexpected AST node: %s %s (file %r, line %s)' % (
|
|
372
|
+
node_or_string,
|
|
373
|
+
ast.dump(node_or_string),
|
|
374
|
+
filename,
|
|
375
|
+
getattr(node_or_string, 'lineno', '<unknown>')))
|
|
376
|
+
|
|
377
|
+
statements = {}
|
|
378
|
+
for statement in node_or_string.body:
|
|
379
|
+
_validate_statement(statement, statements)
|
|
380
|
+
statements[statement.targets[0].id] = statement.value
|
|
381
|
+
|
|
382
|
+
# The tokenized representation needs to end with a newline token, otherwise
|
|
383
|
+
# untokenization will trigger an assert later on.
|
|
384
|
+
# In Python 2.7 on Windows we need to ensure the input ends with a newline
|
|
385
|
+
# for a newline token to be generated.
|
|
386
|
+
# In other cases a newline token is always generated during tokenization so
|
|
387
|
+
# this has no effect.
|
|
388
|
+
# TODO: Remove this workaround after migrating to Python 3.
|
|
389
|
+
content += '\n'
|
|
390
|
+
tokens = {
|
|
391
|
+
token[2]: list(token) for token in tokenize.generate_tokens(
|
|
392
|
+
StringIO(content).readline)
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
local_scope = _NodeDict({}, tokens)
|
|
396
|
+
|
|
397
|
+
# Process vars first, so we can expand variables in the rest of the DEPS file.
|
|
398
|
+
vars_dict = {}
|
|
399
|
+
if 'vars' in statements:
|
|
400
|
+
vars_statement = statements['vars']
|
|
401
|
+
value = _gclient_eval(vars_statement, filename)
|
|
402
|
+
local_scope.SetNode('vars', value, vars_statement)
|
|
403
|
+
# Update the parsed vars with the overrides, but only if they are already
|
|
404
|
+
# present (overrides do not introduce new variables).
|
|
405
|
+
vars_dict.update(value)
|
|
406
|
+
|
|
407
|
+
if builtin_vars:
|
|
408
|
+
vars_dict.update(builtin_vars)
|
|
409
|
+
|
|
410
|
+
if vars_override:
|
|
411
|
+
vars_dict.update({k: v for k, v in vars_override.items() if k in vars_dict})
|
|
412
|
+
|
|
413
|
+
for name, node in statements.items():
|
|
414
|
+
value = _gclient_eval(node, filename, vars_dict)
|
|
415
|
+
local_scope.SetNode(name, value, node)
|
|
416
|
+
|
|
417
|
+
try:
|
|
418
|
+
return _GCLIENT_SCHEMA.validate(local_scope)
|
|
419
|
+
except schema.SchemaError as e:
|
|
420
|
+
raise gclient_utils.Error(str(e))
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
def _StandardizeDeps(deps_dict, vars_dict):
|
|
424
|
+
""""Standardizes the deps_dict.
|
|
425
|
+
|
|
426
|
+
For each dependency:
|
|
427
|
+
- Expands the variable in the dependency name.
|
|
428
|
+
- Ensures the dependency is a dictionary.
|
|
429
|
+
- Set's the 'dep_type' to be 'git' by default.
|
|
430
|
+
"""
|
|
431
|
+
new_deps_dict = {}
|
|
432
|
+
for dep_name, dep_info in deps_dict.items():
|
|
433
|
+
dep_name = dep_name.format(**vars_dict)
|
|
434
|
+
if not isinstance(dep_info, collections_abc.Mapping):
|
|
435
|
+
dep_info = {'url': dep_info}
|
|
436
|
+
dep_info.setdefault('dep_type', 'git')
|
|
437
|
+
new_deps_dict[dep_name] = dep_info
|
|
438
|
+
return new_deps_dict
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
def _MergeDepsOs(deps_dict, os_deps_dict, os_name):
|
|
442
|
+
"""Merges the deps in os_deps_dict into conditional dependencies in deps_dict.
|
|
443
|
+
|
|
444
|
+
The dependencies in os_deps_dict are transformed into conditional dependencies
|
|
445
|
+
using |'checkout_' + os_name|.
|
|
446
|
+
If the dependency is already present, the URL and revision must coincide.
|
|
447
|
+
"""
|
|
448
|
+
for dep_name, dep_info in os_deps_dict.items():
|
|
449
|
+
# Make this condition very visible, so it's not a silent failure.
|
|
450
|
+
# It's unclear how to support None override in deps_os.
|
|
451
|
+
if dep_info['url'] is None:
|
|
452
|
+
logging.error('Ignoring %r:%r in %r deps_os', dep_name, dep_info, os_name)
|
|
453
|
+
continue
|
|
454
|
+
|
|
455
|
+
os_condition = 'checkout_' + (os_name if os_name != 'unix' else 'linux')
|
|
456
|
+
UpdateCondition(dep_info, 'and', os_condition)
|
|
457
|
+
|
|
458
|
+
if dep_name in deps_dict:
|
|
459
|
+
if deps_dict[dep_name]['url'] != dep_info['url']:
|
|
460
|
+
raise gclient_utils.Error(
|
|
461
|
+
'Value from deps_os (%r; %r: %r) conflicts with existing deps '
|
|
462
|
+
'entry (%r).' % (
|
|
463
|
+
os_name, dep_name, dep_info, deps_dict[dep_name]))
|
|
464
|
+
|
|
465
|
+
UpdateCondition(dep_info, 'or', deps_dict[dep_name].get('condition'))
|
|
466
|
+
|
|
467
|
+
deps_dict[dep_name] = dep_info
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
def UpdateCondition(info_dict, op, new_condition):
|
|
471
|
+
"""Updates info_dict's condition with |new_condition|.
|
|
472
|
+
|
|
473
|
+
An absent value is treated as implicitly True.
|
|
474
|
+
"""
|
|
475
|
+
curr_condition = info_dict.get('condition')
|
|
476
|
+
# Easy case: Both are present.
|
|
477
|
+
if curr_condition and new_condition:
|
|
478
|
+
info_dict['condition'] = '(%s) %s (%s)' % (
|
|
479
|
+
curr_condition, op, new_condition)
|
|
480
|
+
# If |op| == 'and', and at least one condition is present, then use it.
|
|
481
|
+
elif op == 'and' and (curr_condition or new_condition):
|
|
482
|
+
info_dict['condition'] = curr_condition or new_condition
|
|
483
|
+
# Otherwise, no condition should be set
|
|
484
|
+
elif curr_condition:
|
|
485
|
+
del info_dict['condition']
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def Parse(content, filename, vars_override=None, builtin_vars=None):
|
|
489
|
+
"""Parses DEPS strings.
|
|
490
|
+
|
|
491
|
+
Executes the Python-like string stored in content, resulting in a Python
|
|
492
|
+
dictionary specified by the schema above. Supports syntax validation and
|
|
493
|
+
variable expansion.
|
|
494
|
+
|
|
495
|
+
Args:
|
|
496
|
+
content: str. DEPS file stored as a string.
|
|
497
|
+
filename: str. The name of the DEPS file, or a string describing the source
|
|
498
|
+
of the content, e.g. '<string>', '<unknown>'.
|
|
499
|
+
vars_override: dict, optional. A dictionary with overrides for the variables
|
|
500
|
+
defined by the DEPS file.
|
|
501
|
+
builtin_vars: dict, optional. A dictionary with variables that are provided
|
|
502
|
+
by default.
|
|
503
|
+
|
|
504
|
+
Returns:
|
|
505
|
+
A Python dict with the parsed contents of the DEPS file, as specified by the
|
|
506
|
+
schema above.
|
|
507
|
+
"""
|
|
508
|
+
result = Exec(content, filename, vars_override, builtin_vars)
|
|
509
|
+
|
|
510
|
+
vars_dict = result.get('vars', {})
|
|
511
|
+
if 'deps' in result:
|
|
512
|
+
result['deps'] = _StandardizeDeps(result['deps'], vars_dict)
|
|
513
|
+
|
|
514
|
+
if 'deps_os' in result:
|
|
515
|
+
deps = result.setdefault('deps', {})
|
|
516
|
+
for os_name, os_deps in result['deps_os'].items():
|
|
517
|
+
os_deps = _StandardizeDeps(os_deps, vars_dict)
|
|
518
|
+
_MergeDepsOs(deps, os_deps, os_name)
|
|
519
|
+
del result['deps_os']
|
|
520
|
+
|
|
521
|
+
if 'hooks_os' in result:
|
|
522
|
+
hooks = result.setdefault('hooks', [])
|
|
523
|
+
for os_name, os_hooks in result['hooks_os'].items():
|
|
524
|
+
for hook in os_hooks:
|
|
525
|
+
UpdateCondition(hook, 'and', 'checkout_' + os_name)
|
|
526
|
+
hooks.extend(os_hooks)
|
|
527
|
+
del result['hooks_os']
|
|
528
|
+
|
|
529
|
+
return result
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
def EvaluateCondition(condition, variables, referenced_variables=None):
|
|
533
|
+
"""Safely evaluates a boolean condition. Returns the result."""
|
|
534
|
+
if not referenced_variables:
|
|
535
|
+
referenced_variables = set()
|
|
536
|
+
_allowed_names = {'None': None, 'True': True, 'False': False}
|
|
537
|
+
main_node = ast.parse(condition, mode='eval')
|
|
538
|
+
if isinstance(main_node, ast.Expression):
|
|
539
|
+
main_node = main_node.body
|
|
540
|
+
def _convert(node, allow_tuple=False):
|
|
541
|
+
if isinstance(node, ast.Str):
|
|
542
|
+
return node.s
|
|
543
|
+
elif isinstance(node, ast.Tuple) and allow_tuple:
|
|
544
|
+
return tuple(map(_convert, node.elts))
|
|
545
|
+
elif isinstance(node, ast.Name):
|
|
546
|
+
if node.id in referenced_variables:
|
|
547
|
+
raise ValueError(
|
|
548
|
+
'invalid cyclic reference to %r (inside %r)' % (
|
|
549
|
+
node.id, condition))
|
|
550
|
+
elif node.id in _allowed_names:
|
|
551
|
+
return _allowed_names[node.id]
|
|
552
|
+
elif node.id in variables:
|
|
553
|
+
value = variables[node.id]
|
|
554
|
+
|
|
555
|
+
# Allow using "native" types, without wrapping everything in strings.
|
|
556
|
+
# Note that schema constraints still apply to variables.
|
|
557
|
+
if not isinstance(value, basestring):
|
|
558
|
+
return value
|
|
559
|
+
|
|
560
|
+
# Recursively evaluate the variable reference.
|
|
561
|
+
return EvaluateCondition(
|
|
562
|
+
variables[node.id],
|
|
563
|
+
variables,
|
|
564
|
+
referenced_variables.union([node.id]))
|
|
565
|
+
else:
|
|
566
|
+
# Implicitly convert unrecognized names to strings.
|
|
567
|
+
# If we want to change this, we'll need to explicitly distinguish
|
|
568
|
+
# between arguments for GN to be passed verbatim, and ones to
|
|
569
|
+
# be evaluated.
|
|
570
|
+
return node.id
|
|
571
|
+
elif not sys.version_info[:2] < (3, 4) and isinstance(
|
|
572
|
+
node, ast.NameConstant): # Since Python 3.4
|
|
573
|
+
return node.value
|
|
574
|
+
elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or):
|
|
575
|
+
bool_values = []
|
|
576
|
+
for value in node.values:
|
|
577
|
+
bool_values.append(_convert(value))
|
|
578
|
+
if not isinstance(bool_values[-1], bool):
|
|
579
|
+
raise ValueError(
|
|
580
|
+
'invalid "or" operand %r (inside %r)' % (
|
|
581
|
+
bool_values[-1], condition))
|
|
582
|
+
return any(bool_values)
|
|
583
|
+
elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.And):
|
|
584
|
+
bool_values = []
|
|
585
|
+
for value in node.values:
|
|
586
|
+
bool_values.append(_convert(value))
|
|
587
|
+
if not isinstance(bool_values[-1], bool):
|
|
588
|
+
raise ValueError(
|
|
589
|
+
'invalid "and" operand %r (inside %r)' % (
|
|
590
|
+
bool_values[-1], condition))
|
|
591
|
+
return all(bool_values)
|
|
592
|
+
elif isinstance(node, ast.UnaryOp) and isinstance(node.op, ast.Not):
|
|
593
|
+
value = _convert(node.operand)
|
|
594
|
+
if not isinstance(value, bool):
|
|
595
|
+
raise ValueError(
|
|
596
|
+
'invalid "not" operand %r (inside %r)' % (value, condition))
|
|
597
|
+
return not value
|
|
598
|
+
elif isinstance(node, ast.Compare):
|
|
599
|
+
if len(node.ops) != 1:
|
|
600
|
+
raise ValueError(
|
|
601
|
+
'invalid compare: exactly 1 operator required (inside %r)' % (
|
|
602
|
+
condition))
|
|
603
|
+
if len(node.comparators) != 1:
|
|
604
|
+
raise ValueError(
|
|
605
|
+
'invalid compare: exactly 1 comparator required (inside %r)' % (
|
|
606
|
+
condition))
|
|
607
|
+
|
|
608
|
+
left = _convert(node.left)
|
|
609
|
+
right = _convert(
|
|
610
|
+
node.comparators[0], allow_tuple=isinstance(node.ops[0], ast.In))
|
|
611
|
+
|
|
612
|
+
if isinstance(node.ops[0], ast.Eq):
|
|
613
|
+
return left == right
|
|
614
|
+
if isinstance(node.ops[0], ast.NotEq):
|
|
615
|
+
return left != right
|
|
616
|
+
if isinstance(node.ops[0], ast.In):
|
|
617
|
+
return left in right
|
|
618
|
+
|
|
619
|
+
raise ValueError(
|
|
620
|
+
'unexpected operator: %s %s (inside %r)' % (
|
|
621
|
+
node.ops[0], ast.dump(node), condition))
|
|
622
|
+
else:
|
|
623
|
+
raise ValueError(
|
|
624
|
+
'unexpected AST node: %s %s (inside %r)' % (
|
|
625
|
+
node, ast.dump(node), condition))
|
|
626
|
+
return _convert(main_node)
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
def RenderDEPSFile(gclient_dict):
|
|
630
|
+
contents = sorted(gclient_dict.tokens.values(), key=lambda token: token[2])
|
|
631
|
+
# The last token is a newline, which we ensure in Exec() for compatibility.
|
|
632
|
+
# However tests pass in inputs not ending with a newline and expect the same
|
|
633
|
+
# back, so for backwards compatibility need to remove that newline character.
|
|
634
|
+
# TODO: Fix tests to expect the newline
|
|
635
|
+
return tokenize.untokenize(contents)[:-1]
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
def _UpdateAstString(tokens, node, value):
|
|
639
|
+
if isinstance(node, ast.Call):
|
|
640
|
+
node = node.args[0]
|
|
641
|
+
position = node.lineno, node.col_offset
|
|
642
|
+
quote_char = ''
|
|
643
|
+
if isinstance(node, ast.Str):
|
|
644
|
+
quote_char = tokens[position][1][0]
|
|
645
|
+
value = value.encode('unicode_escape').decode('utf-8')
|
|
646
|
+
tokens[position][1] = quote_char + value + quote_char
|
|
647
|
+
node.s = value
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
def _ShiftLinesInTokens(tokens, delta, start):
|
|
651
|
+
new_tokens = {}
|
|
652
|
+
for token in tokens.values():
|
|
653
|
+
if token[2][0] >= start:
|
|
654
|
+
token[2] = token[2][0] + delta, token[2][1]
|
|
655
|
+
token[3] = token[3][0] + delta, token[3][1]
|
|
656
|
+
new_tokens[token[2]] = token
|
|
657
|
+
return new_tokens
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
def AddVar(gclient_dict, var_name, value):
|
|
661
|
+
if not isinstance(gclient_dict, _NodeDict) or gclient_dict.tokens is None:
|
|
662
|
+
raise ValueError(
|
|
663
|
+
"Can't use SetVar for the given gclient dict. It contains no "
|
|
664
|
+
"formatting information.")
|
|
665
|
+
|
|
666
|
+
if 'vars' not in gclient_dict:
|
|
667
|
+
raise KeyError("vars dict is not defined.")
|
|
668
|
+
|
|
669
|
+
if var_name in gclient_dict['vars']:
|
|
670
|
+
raise ValueError(
|
|
671
|
+
"%s has already been declared in the vars dict. Consider using SetVar "
|
|
672
|
+
"instead." % var_name)
|
|
673
|
+
|
|
674
|
+
if not gclient_dict['vars']:
|
|
675
|
+
raise ValueError('vars dict is empty. This is not yet supported.')
|
|
676
|
+
|
|
677
|
+
# We will attempt to add the var right after 'vars = {'.
|
|
678
|
+
node = gclient_dict.GetNode('vars')
|
|
679
|
+
if node is None:
|
|
680
|
+
raise ValueError(
|
|
681
|
+
"The vars dict has no formatting information." % var_name)
|
|
682
|
+
line = node.lineno + 1
|
|
683
|
+
|
|
684
|
+
# We will try to match the new var's indentation to the next variable.
|
|
685
|
+
col = node.keys[0].col_offset
|
|
686
|
+
|
|
687
|
+
# We use a minimal Python dictionary, so that ast can parse it.
|
|
688
|
+
var_content = '{\n%s"%s": "%s",\n}\n' % (' ' * col, var_name, value)
|
|
689
|
+
var_ast = ast.parse(var_content).body[0].value
|
|
690
|
+
|
|
691
|
+
# Set the ast nodes for the key and value.
|
|
692
|
+
vars_node = gclient_dict.GetNode('vars')
|
|
693
|
+
|
|
694
|
+
var_name_node = var_ast.keys[0]
|
|
695
|
+
var_name_node.lineno += line - 2
|
|
696
|
+
vars_node.keys.insert(0, var_name_node)
|
|
697
|
+
|
|
698
|
+
value_node = var_ast.values[0]
|
|
699
|
+
value_node.lineno += line - 2
|
|
700
|
+
vars_node.values.insert(0, value_node)
|
|
701
|
+
|
|
702
|
+
# Update the tokens.
|
|
703
|
+
var_tokens = list(tokenize.generate_tokens(StringIO(var_content).readline))
|
|
704
|
+
var_tokens = {
|
|
705
|
+
token[2]: list(token)
|
|
706
|
+
# Ignore the tokens corresponding to braces and new lines.
|
|
707
|
+
for token in var_tokens[2:-3]
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
gclient_dict.tokens = _ShiftLinesInTokens(gclient_dict.tokens, 1, line)
|
|
711
|
+
gclient_dict.tokens.update(_ShiftLinesInTokens(var_tokens, line - 2, 0))
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
def SetVar(gclient_dict, var_name, value):
|
|
715
|
+
if not isinstance(gclient_dict, _NodeDict) or gclient_dict.tokens is None:
|
|
716
|
+
raise ValueError(
|
|
717
|
+
"Can't use SetVar for the given gclient dict. It contains no "
|
|
718
|
+
"formatting information.")
|
|
719
|
+
tokens = gclient_dict.tokens
|
|
720
|
+
|
|
721
|
+
if 'vars' not in gclient_dict:
|
|
722
|
+
raise KeyError("vars dict is not defined.")
|
|
723
|
+
|
|
724
|
+
if var_name not in gclient_dict['vars']:
|
|
725
|
+
raise ValueError(
|
|
726
|
+
"%s has not been declared in the vars dict. Consider using AddVar "
|
|
727
|
+
"instead." % var_name)
|
|
728
|
+
|
|
729
|
+
node = gclient_dict['vars'].GetNode(var_name)
|
|
730
|
+
if node is None:
|
|
731
|
+
raise ValueError(
|
|
732
|
+
"The vars entry for %s has no formatting information." % var_name)
|
|
733
|
+
|
|
734
|
+
_UpdateAstString(tokens, node, value)
|
|
735
|
+
gclient_dict['vars'].SetNode(var_name, value, node)
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
def _GetVarName(node):
|
|
739
|
+
if isinstance(node, ast.Call):
|
|
740
|
+
return node.args[0].s
|
|
741
|
+
elif node.s.endswith('}'):
|
|
742
|
+
last_brace = node.s.rfind('{')
|
|
743
|
+
return node.s[last_brace+1:-1]
|
|
744
|
+
return None
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
def SetCIPD(gclient_dict, dep_name, package_name, new_version):
|
|
748
|
+
if not isinstance(gclient_dict, _NodeDict) or gclient_dict.tokens is None:
|
|
749
|
+
raise ValueError(
|
|
750
|
+
"Can't use SetCIPD for the given gclient dict. It contains no "
|
|
751
|
+
"formatting information.")
|
|
752
|
+
tokens = gclient_dict.tokens
|
|
753
|
+
|
|
754
|
+
if 'deps' not in gclient_dict or dep_name not in gclient_dict['deps']:
|
|
755
|
+
raise KeyError(
|
|
756
|
+
"Could not find any dependency called %s." % dep_name)
|
|
757
|
+
|
|
758
|
+
# Find the package with the given name
|
|
759
|
+
packages = [
|
|
760
|
+
package
|
|
761
|
+
for package in gclient_dict['deps'][dep_name]['packages']
|
|
762
|
+
if package['package'] == package_name
|
|
763
|
+
]
|
|
764
|
+
if len(packages) != 1:
|
|
765
|
+
raise ValueError(
|
|
766
|
+
"There must be exactly one package with the given name (%s), "
|
|
767
|
+
"%s were found." % (package_name, len(packages)))
|
|
768
|
+
|
|
769
|
+
# TODO(ehmaldonado): Support Var in package's version.
|
|
770
|
+
node = packages[0].GetNode('version')
|
|
771
|
+
if node is None:
|
|
772
|
+
raise ValueError(
|
|
773
|
+
"The deps entry for %s:%s has no formatting information." %
|
|
774
|
+
(dep_name, package_name))
|
|
775
|
+
|
|
776
|
+
if not isinstance(node, ast.Call) and not isinstance(node, ast.Str):
|
|
777
|
+
raise ValueError(
|
|
778
|
+
"Unsupported dependency revision format. Please file a bug to the "
|
|
779
|
+
"Infra>SDK component in crbug.com")
|
|
780
|
+
|
|
781
|
+
var_name = _GetVarName(node)
|
|
782
|
+
if var_name is not None:
|
|
783
|
+
SetVar(gclient_dict, var_name, new_version)
|
|
784
|
+
else:
|
|
785
|
+
_UpdateAstString(tokens, node, new_version)
|
|
786
|
+
packages[0].SetNode('version', new_version, node)
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
def SetRevision(gclient_dict, dep_name, new_revision):
|
|
790
|
+
def _UpdateRevision(dep_dict, dep_key, new_revision):
|
|
791
|
+
dep_node = dep_dict.GetNode(dep_key)
|
|
792
|
+
if dep_node is None:
|
|
793
|
+
raise ValueError(
|
|
794
|
+
"The deps entry for %s has no formatting information." % dep_name)
|
|
795
|
+
|
|
796
|
+
node = dep_node
|
|
797
|
+
if isinstance(node, ast.BinOp):
|
|
798
|
+
node = node.right
|
|
799
|
+
|
|
800
|
+
if isinstance(node, ast.Str):
|
|
801
|
+
token = _gclient_eval(tokens[node.lineno, node.col_offset][1])
|
|
802
|
+
if token != node.s:
|
|
803
|
+
raise ValueError(
|
|
804
|
+
'Can\'t update value for %s. Multiline strings and implicitly '
|
|
805
|
+
'concatenated strings are not supported.\n'
|
|
806
|
+
'Consider reformatting the DEPS file.' % dep_key)
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
if not isinstance(node, ast.Call) and not isinstance(node, ast.Str):
|
|
810
|
+
raise ValueError(
|
|
811
|
+
"Unsupported dependency revision format. Please file a bug to the "
|
|
812
|
+
"Infra>SDK component in crbug.com")
|
|
813
|
+
|
|
814
|
+
var_name = _GetVarName(node)
|
|
815
|
+
if var_name is not None:
|
|
816
|
+
SetVar(gclient_dict, var_name, new_revision)
|
|
817
|
+
else:
|
|
818
|
+
if '@' in node.s:
|
|
819
|
+
# '@' is part of the last string, which we want to modify. Discard
|
|
820
|
+
# whatever was after the '@' and put the new revision in its place.
|
|
821
|
+
new_revision = node.s.split('@')[0] + '@' + new_revision
|
|
822
|
+
elif '@' not in dep_dict[dep_key]:
|
|
823
|
+
# '@' is not part of the URL at all. This mean the dependency is
|
|
824
|
+
# unpinned and we should pin it.
|
|
825
|
+
new_revision = node.s + '@' + new_revision
|
|
826
|
+
_UpdateAstString(tokens, node, new_revision)
|
|
827
|
+
dep_dict.SetNode(dep_key, new_revision, node)
|
|
828
|
+
|
|
829
|
+
if not isinstance(gclient_dict, _NodeDict) or gclient_dict.tokens is None:
|
|
830
|
+
raise ValueError(
|
|
831
|
+
"Can't use SetRevision for the given gclient dict. It contains no "
|
|
832
|
+
"formatting information.")
|
|
833
|
+
tokens = gclient_dict.tokens
|
|
834
|
+
|
|
835
|
+
if 'deps' not in gclient_dict or dep_name not in gclient_dict['deps']:
|
|
836
|
+
raise KeyError(
|
|
837
|
+
"Could not find any dependency called %s." % dep_name)
|
|
838
|
+
|
|
839
|
+
if isinstance(gclient_dict['deps'][dep_name], _NodeDict):
|
|
840
|
+
_UpdateRevision(gclient_dict['deps'][dep_name], 'url', new_revision)
|
|
841
|
+
else:
|
|
842
|
+
_UpdateRevision(gclient_dict['deps'], dep_name, new_revision)
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
def GetVar(gclient_dict, var_name):
|
|
846
|
+
if 'vars' not in gclient_dict or var_name not in gclient_dict['vars']:
|
|
847
|
+
raise KeyError(
|
|
848
|
+
"Could not find any variable called %s." % var_name)
|
|
849
|
+
|
|
850
|
+
val = gclient_dict['vars'][var_name]
|
|
851
|
+
if isinstance(val, ConstantString):
|
|
852
|
+
return val.value
|
|
853
|
+
return val
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
def GetCIPD(gclient_dict, dep_name, package_name):
|
|
857
|
+
if 'deps' not in gclient_dict or dep_name not in gclient_dict['deps']:
|
|
858
|
+
raise KeyError(
|
|
859
|
+
"Could not find any dependency called %s." % dep_name)
|
|
860
|
+
|
|
861
|
+
# Find the package with the given name
|
|
862
|
+
packages = [
|
|
863
|
+
package
|
|
864
|
+
for package in gclient_dict['deps'][dep_name]['packages']
|
|
865
|
+
if package['package'] == package_name
|
|
866
|
+
]
|
|
867
|
+
if len(packages) != 1:
|
|
868
|
+
raise ValueError(
|
|
869
|
+
"There must be exactly one package with the given name (%s), "
|
|
870
|
+
"%s were found." % (package_name, len(packages)))
|
|
871
|
+
|
|
872
|
+
return packages[0]['version']
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
def GetRevision(gclient_dict, dep_name):
|
|
876
|
+
if 'deps' not in gclient_dict or dep_name not in gclient_dict['deps']:
|
|
877
|
+
raise KeyError(
|
|
878
|
+
"Could not find any dependency called %s." % dep_name)
|
|
879
|
+
|
|
880
|
+
dep = gclient_dict['deps'][dep_name]
|
|
881
|
+
if dep is None:
|
|
882
|
+
return None
|
|
883
|
+
elif isinstance(dep, basestring):
|
|
884
|
+
_, _, revision = dep.partition('@')
|
|
885
|
+
return revision or None
|
|
886
|
+
elif isinstance(dep, collections_abc.Mapping) and 'url' in dep:
|
|
887
|
+
_, _, revision = dep['url'].partition('@')
|
|
888
|
+
return revision or None
|
|
889
|
+
else:
|
|
890
|
+
raise ValueError(
|
|
891
|
+
'%s is not a valid git dependency.' % dep_name)
|