libv8 4.5.95.5 → 5.0.71.48.0beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +45 -19
- data/CHANGELOG.md +14 -0
- data/README.md +30 -15
- data/Rakefile +7 -6
- data/ext/libv8/arch.rb +5 -4
- data/ext/libv8/builder.rb +25 -19
- data/ext/libv8/compiler.rb +6 -33
- data/ext/libv8/location.rb +7 -8
- data/lib/libv8/version.rb +1 -1
- data/libv8.gemspec +1 -1
- data/patches/build-standalone-static-library.patch +14 -0
- data/patches/disable-building-tests.patch +48 -10
- data/patches/fPIC-for-static.patch +3 -3
- data/release/x86-linux/Vagrantfile +8 -4
- data/release/x86_64-freebsd10/Vagrantfile +86 -0
- data/release/x86_64-linux/Vagrantfile +8 -4
- data/spec/compiler_spec.rb +5 -29
- data/spec/support/compiler_helpers.rb +2 -4
- data/vendor/depot_tools/.gitignore +15 -3
- data/vendor/depot_tools/OWNERS +2 -2
- data/vendor/depot_tools/PRESUBMIT.py +4 -2
- data/vendor/depot_tools/WATCHLISTS +6 -0
- data/vendor/depot_tools/apply_issue.py +70 -38
- data/vendor/depot_tools/bootstrap/win/README.md +66 -0
- data/vendor/depot_tools/bootstrap/win/git-bash.template.sh +12 -0
- data/vendor/depot_tools/bootstrap/win/git.template.bat +5 -0
- data/vendor/depot_tools/bootstrap/win/profile.d.python.sh +20 -0
- data/vendor/depot_tools/bootstrap/win/win_tools.bat +96 -45
- data/vendor/depot_tools/breakpad.py +6 -141
- data/vendor/depot_tools/buildbucket.py +45 -31
- data/vendor/depot_tools/cbuildbot +1 -0
- data/vendor/depot_tools/checkout.py +2 -1
- data/vendor/depot_tools/chrome_set_ver +1 -0
- data/vendor/depot_tools/cit +8 -0
- data/vendor/depot_tools/cit.bat +11 -0
- data/vendor/depot_tools/cit.py +120 -0
- data/vendor/depot_tools/codereview.settings +0 -2
- data/vendor/depot_tools/commit_queue +1 -5
- data/vendor/depot_tools/commit_queue.bat +1 -4
- data/vendor/depot_tools/commit_queue.py +78 -29
- data/vendor/depot_tools/cpplint.py +22 -14
- data/vendor/depot_tools/cros +1 -0
- data/vendor/depot_tools/cros_sdk +1 -0
- data/vendor/depot_tools/depot-tools-auth.py +3 -3
- data/vendor/depot_tools/download_from_google_storage.py +101 -21
- data/vendor/depot_tools/drover.py +2 -3
- data/vendor/depot_tools/fetch.py +31 -27
- data/vendor/depot_tools/{recipes → fetch_configs}/android.py +4 -4
- data/vendor/depot_tools/fetch_configs/breakpad.py +45 -0
- data/vendor/depot_tools/{recipes → fetch_configs}/chromium.py +3 -3
- data/vendor/depot_tools/{recipes/recipe_util.py → fetch_configs/config_util.py} +3 -3
- data/vendor/depot_tools/fetch_configs/crashpad.py +41 -0
- data/vendor/depot_tools/{recipes → fetch_configs}/dart.py +3 -3
- data/vendor/depot_tools/{recipes/pdfium.py → fetch_configs/dartino.py} +14 -13
- data/vendor/depot_tools/{recipes → fetch_configs}/dartium.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/depot_tools.py +3 -3
- data/vendor/depot_tools/fetch_configs/gyp.py +42 -0
- data/vendor/depot_tools/{recipes → fetch_configs}/infra.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/infra_internal.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/ios.py +4 -4
- data/vendor/depot_tools/{recipes → fetch_configs}/mojo.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/nacl.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/naclports.py +3 -3
- data/vendor/depot_tools/fetch_configs/pdfium.py +40 -0
- data/vendor/depot_tools/{recipes → fetch_configs}/skia.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/skia_buildbot.py +3 -3
- data/vendor/depot_tools/fetch_configs/syzygy.py +41 -0
- data/vendor/depot_tools/{recipes → fetch_configs}/v8.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/webrtc.py +3 -3
- data/vendor/depot_tools/{recipes → fetch_configs}/webrtc_android.py +4 -4
- data/vendor/depot_tools/{recipes → fetch_configs}/webrtc_ios.py +4 -4
- data/vendor/depot_tools/fix_encoding.py +6 -6
- data/vendor/depot_tools/gcl.py +11 -21
- data/vendor/depot_tools/gclient +10 -0
- data/vendor/depot_tools/gclient-new-workdir.py +7 -38
- data/vendor/depot_tools/gclient.bat +2 -2
- data/vendor/depot_tools/gclient.py +85 -65
- data/vendor/depot_tools/gclient_scm.py +83 -10
- data/vendor/depot_tools/gclient_utils.py +5 -1
- data/vendor/depot_tools/gerrit_util.py +243 -26
- data/vendor/depot_tools/git-auto-svn +1 -1
- data/vendor/depot_tools/git-cache +1 -1
- data/vendor/depot_tools/git-cherry-pick-upload +1 -1
- data/vendor/depot_tools/git-cl +1 -1
- data/vendor/depot_tools/git-drover +6 -0
- data/vendor/depot_tools/git-find-releases +6 -0
- data/vendor/depot_tools/git-footers +1 -1
- data/vendor/depot_tools/git-freeze +1 -1
- data/vendor/depot_tools/git-gs +1 -1
- data/vendor/depot_tools/git-hyper-blame +6 -0
- data/vendor/depot_tools/git-map +1 -1
- data/vendor/depot_tools/git-map-branches +1 -1
- data/vendor/depot_tools/git-mark-merge-base +1 -1
- data/vendor/depot_tools/git-nav-downstream +1 -1
- data/vendor/depot_tools/git-new-branch +1 -1
- data/vendor/depot_tools/git-number +1 -1
- data/vendor/depot_tools/git-rebase-update +1 -1
- data/vendor/depot_tools/git-rename-branch +1 -1
- data/vendor/depot_tools/git-reparent-branch +1 -1
- data/vendor/depot_tools/git-retry +1 -1
- data/vendor/depot_tools/git-squash-branch +1 -1
- data/vendor/depot_tools/git-thaw +1 -1
- data/vendor/depot_tools/git-try +1 -1
- data/vendor/depot_tools/git-upstream-diff +1 -1
- data/vendor/depot_tools/git_auto_svn.py +24 -6
- data/vendor/depot_tools/git_cache.py +74 -27
- data/vendor/depot_tools/git_cl.py +2118 -747
- data/vendor/depot_tools/git_common.py +100 -6
- data/vendor/depot_tools/git_dates.py +62 -0
- data/vendor/depot_tools/git_drover.py +424 -0
- data/vendor/depot_tools/git_find_releases.py +65 -0
- data/vendor/depot_tools/git_footers.py +42 -0
- data/vendor/depot_tools/git_hyper_blame.py +391 -0
- data/vendor/depot_tools/git_map_branches.py +8 -6
- data/vendor/depot_tools/git_new_branch.py +6 -1
- data/vendor/depot_tools/git_rebase_update.py +56 -16
- data/vendor/depot_tools/git_reparent_branch.py +13 -0
- data/vendor/depot_tools/git_try.py +0 -2
- data/vendor/depot_tools/gsutil.py +51 -20
- data/vendor/depot_tools/infra/config/OWNERS +3 -1
- data/vendor/depot_tools/infra/config/cq.cfg +7 -3
- data/vendor/depot_tools/infra/config/recipes.cfg +9 -0
- data/vendor/depot_tools/luci_hacks/README.md +35 -0
- data/vendor/depot_tools/{bootstrap/virtualenv/tests → luci_hacks}/__init__.py +0 -0
- data/vendor/depot_tools/luci_hacks/luci_recipe_run.isolate +12 -0
- data/vendor/depot_tools/luci_hacks/luci_recipe_run.py +81 -0
- data/vendor/depot_tools/luci_hacks/trigger_luci_job.py +128 -0
- data/vendor/depot_tools/man/html/depot_tools.html +9 -1
- data/vendor/depot_tools/man/html/depot_tools_tutorial.html +4 -4
- data/vendor/depot_tools/man/html/git-drover.html +191 -35
- data/vendor/depot_tools/man/html/git-hyper-blame.html +878 -0
- data/vendor/depot_tools/man/html/git-rebase-update.html +9 -4
- data/vendor/depot_tools/man/man1/git-drover.1 +189 -36
- data/vendor/depot_tools/man/man1/git-hyper-blame.1 +128 -0
- data/vendor/depot_tools/man/man1/git-rebase-update.1 +8 -6
- data/vendor/depot_tools/man/man7/depot_tools.7 +9 -4
- data/vendor/depot_tools/man/src/_git-hyper-blame_desc.helper.txt +1 -0
- data/vendor/depot_tools/man/src/common_demo_functions.sh +5 -0
- data/vendor/depot_tools/man/src/depot_tools_tutorial.txt +1 -1
- data/vendor/depot_tools/man/src/git-drover.demo.1.sh +11 -16
- 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.txt +49 -3
- 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-rebase-update.txt +5 -1
- data/vendor/depot_tools/my_activity.py +6 -21
- 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/presubmit_canned_checks.py +83 -69
- data/vendor/depot_tools/presubmit_support.py +126 -42
- data/vendor/depot_tools/pylint.py +5 -1
- data/vendor/depot_tools/python_runner.sh +55 -0
- data/vendor/depot_tools/recipe_modules/bot_update/__init__.py +32 -0
- data/vendor/depot_tools/recipe_modules/bot_update/api.py +283 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic.json +56 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_output_manifest.json +63 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +57 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/clobber.json +44 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/forced.json +57 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +44 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/no_shallow.json +44 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/off.json +43 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +43 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/svn_mode.json +59 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange.json +58 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/trychange_oauth2.json +60 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob.json +58 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail.json +60 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +81 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +81 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +49 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8.json +61 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +51 -0
- data/vendor/depot_tools/recipe_modules/bot_update/example.py +172 -0
- data/vendor/depot_tools/{bootstrap/virtualenv/virtualenv_support → recipe_modules/bot_update/resources}/__init__.py +0 -0
- data/vendor/depot_tools/recipe_modules/bot_update/resources/bot_update.py +1764 -0
- data/vendor/depot_tools/recipe_modules/bot_update/test_api.py +86 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/__init__.py +3 -0
- data/vendor/depot_tools/recipe_modules/depot_tools/api.py +27 -0
- data/vendor/depot_tools/recipe_modules/gclient/__init__.py +10 -0
- data/vendor/depot_tools/recipe_modules/gclient/api.py +378 -0
- data/vendor/depot_tools/recipe_modules/gclient/config.py +671 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/basic.json +172 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/revision.json +174 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.expected/tryserver.json +185 -0
- data/vendor/depot_tools/recipe_modules/gclient/example.py +100 -0
- data/vendor/depot_tools/recipe_modules/gclient/test_api.py +37 -0
- data/vendor/depot_tools/recipe_modules/git/__init__.py +9 -0
- data/vendor/depot_tools/recipe_modules/git/api.py +377 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic.json +177 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_branch.json +177 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_file_name.json +179 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_hash.json +176 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_ref.json +177 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/basic_submodule_update_force.json +178 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/can_fail_build.json +153 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/cannot_fail_build.json +181 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/cat-file_test.json +199 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_delta.json +250 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_failed.json +181 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output.json +182 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/count-objects_with_bad_output_fails_build.json +102 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/curl_trace_file.json +181 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/platform_win.json +186 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/rebase_failed.json +179 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/remote_not_origin.json +179 -0
- data/vendor/depot_tools/recipe_modules/git/example.expected/set_got_revision.json +178 -0
- data/vendor/depot_tools/recipe_modules/git/example.py +147 -0
- data/vendor/depot_tools/recipe_modules/git/resources/git_setup.py +61 -0
- data/vendor/depot_tools/recipe_modules/git/test_api.py +18 -0
- data/vendor/depot_tools/recipe_modules/git_cl/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/git_cl/api.py +25 -0
- data/vendor/depot_tools/recipe_modules/git_cl/config.py +22 -0
- data/vendor/depot_tools/recipe_modules/git_cl/example.expected/basic.json +66 -0
- data/vendor/depot_tools/recipe_modules/git_cl/example.py +41 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/api.py +12 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/basic.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_linux.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_mac.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_buildbot_win.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +14 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/example.py +28 -0
- data/vendor/depot_tools/recipe_modules/infra_paths/path_config.py +45 -0
- data/vendor/depot_tools/recipe_modules/presubmit/__init__.py +4 -0
- data/vendor/depot_tools/recipe_modules/presubmit/api.py +20 -0
- data/vendor/depot_tools/recipe_modules/presubmit/example.expected/basic.json +18 -0
- data/vendor/depot_tools/recipe_modules/presubmit/example.py +15 -0
- data/vendor/depot_tools/recipe_modules/rietveld/__init__.py +5 -0
- data/vendor/depot_tools/recipe_modules/rietveld/api.py +94 -0
- data/vendor/depot_tools/recipe_modules/rietveld/example.expected/basic.json +30 -0
- data/vendor/depot_tools/recipe_modules/rietveld/example.py +24 -0
- data/vendor/depot_tools/recipe_modules/tryserver/__init__.py +15 -0
- data/vendor/depot_tools/recipe_modules/tryserver/api.py +280 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_git_patch.json +104 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch.json +58 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_rietveld_patch_new.json +58 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_svn_patch.json +68 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch.json +43 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.expected/with_wrong_patch_new.json +43 -0
- data/vendor/depot_tools/recipe_modules/tryserver/example.py +53 -0
- data/vendor/depot_tools/recipe_modules/tryserver/test_api.py +7 -0
- data/vendor/depot_tools/recipes.py +136 -0
- data/vendor/depot_tools/repo +1 -1
- data/vendor/depot_tools/rietveld.py +46 -15
- data/vendor/depot_tools/roll_dep.py +97 -36
- data/vendor/depot_tools/scm.py +3 -3
- data/vendor/depot_tools/setup_color.py +94 -0
- data/vendor/depot_tools/subprocess2.py +10 -1
- data/vendor/depot_tools/third_party/cq_client/OWNERS +0 -1
- data/vendor/depot_tools/third_party/cq_client/README.md +47 -9
- data/vendor/depot_tools/third_party/cq_client/cq.pb.go +617 -0
- data/vendor/depot_tools/third_party/cq_client/cq.proto +75 -17
- data/vendor/depot_tools/third_party/cq_client/cq_pb2.py +168 -41
- data/vendor/depot_tools/third_party/cq_client/testdata/cq_gerrit.cfg +55 -0
- data/vendor/depot_tools/third_party/cq_client/{test/cq_example.cfg → testdata/cq_rietveld.cfg} +14 -6
- data/vendor/depot_tools/third_party/fancy_urllib/README +5 -4
- data/vendor/depot_tools/third_party/fancy_urllib/__init__.py +114 -52
- data/vendor/depot_tools/third_party/protobuf26/README.chromium +9 -6
- data/vendor/depot_tools/third_party/upload.py +17 -31
- data/vendor/depot_tools/trychange.py +0 -2
- data/vendor/depot_tools/update_depot_tools +29 -11
- data/vendor/depot_tools/update_depot_tools.bat +4 -9
- data/vendor/depot_tools/upload_to_google_storage.py +42 -5
- data/vendor/depot_tools/win_toolchain/OWNERS +1 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +227 -52
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +203 -88
- metadata +161 -81
- data/patches/arm/do-not-imply-vfp3-and-armv7.patch +0 -16
- data/patches/arm/do-not-use-vfp2.patch +0 -13
- data/patches/clang51/no-unused-variable.patch +0 -12
- data/vendor/depot_tools/bootstrap/.gitignore +0 -2
- data/vendor/depot_tools/bootstrap/bootstrap.py +0 -234
- data/vendor/depot_tools/bootstrap/deps.pyl +0 -15
- data/vendor/depot_tools/bootstrap/util.py +0 -87
- data/vendor/depot_tools/bootstrap/virtualenv/.gitignore +0 -10
- data/vendor/depot_tools/bootstrap/virtualenv/.travis.yml +0 -28
- data/vendor/depot_tools/bootstrap/virtualenv/AUTHORS.txt +0 -91
- data/vendor/depot_tools/bootstrap/virtualenv/CONTRIBUTING.rst +0 -21
- data/vendor/depot_tools/bootstrap/virtualenv/LICENSE.txt +0 -22
- data/vendor/depot_tools/bootstrap/virtualenv/MANIFEST.in +0 -11
- data/vendor/depot_tools/bootstrap/virtualenv/README.rst +0 -10
- data/vendor/depot_tools/bootstrap/virtualenv/bin/rebuild-script.py +0 -71
- data/vendor/depot_tools/bootstrap/virtualenv/docs/changes.rst +0 -747
- data/vendor/depot_tools/bootstrap/virtualenv/docs/conf.py +0 -149
- data/vendor/depot_tools/bootstrap/virtualenv/docs/development.rst +0 -61
- data/vendor/depot_tools/bootstrap/virtualenv/docs/index.rst +0 -137
- data/vendor/depot_tools/bootstrap/virtualenv/docs/installation.rst +0 -58
- data/vendor/depot_tools/bootstrap/virtualenv/docs/make.bat +0 -170
- data/vendor/depot_tools/bootstrap/virtualenv/docs/reference.rst +0 -256
- data/vendor/depot_tools/bootstrap/virtualenv/docs/userguide.rst +0 -249
- data/vendor/depot_tools/bootstrap/virtualenv/scripts/virtualenv +0 -3
- data/vendor/depot_tools/bootstrap/virtualenv/setup.py +0 -111
- data/vendor/depot_tools/bootstrap/virtualenv/tests/test_activate.sh +0 -94
- data/vendor/depot_tools/bootstrap/virtualenv/tests/test_activate_expected.output +0 -2
- data/vendor/depot_tools/bootstrap/virtualenv/tests/test_virtualenv.py +0 -139
- data/vendor/depot_tools/bootstrap/virtualenv/tests/tox.ini +0 -12
- data/vendor/depot_tools/bootstrap/virtualenv/tox.ini +0 -17
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv.py +0 -2367
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/activate.bat +0 -26
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/activate.csh +0 -42
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/activate.fish +0 -74
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/activate.ps1 +0 -150
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/activate.sh +0 -80
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/activate_this.py +0 -34
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/deactivate.bat +0 -20
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/distutils-init.py +0 -101
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/distutils.cfg +0 -6
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_embedded/site.py +0 -758
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_support/pip-6.0-py2.py3-none-any.whl +0 -0
- data/vendor/depot_tools/bootstrap/virtualenv/virtualenv_support/setuptools-8.2.1-py2.py3-none-any.whl +0 -0
- data/vendor/depot_tools/bootstrap/win/README.google +0 -16
- data/vendor/depot_tools/cbuildbot +0 -96
- data/vendor/depot_tools/chrome_set_ver +0 -96
- data/vendor/depot_tools/cros +0 -96
- data/vendor/depot_tools/cros_sdk +0 -96
- data/vendor/depot_tools/git-cl-upload-hook +0 -52
- data/vendor/depot_tools/git-crup +0 -45
- data/vendor/depot_tools/python_git_runner.sh +0 -36
- data/vendor/depot_tools/recipes/blink.py +0 -59
- data/vendor/depot_tools/third_party/cq_client/test/validate_config_test.py +0 -52
- data/vendor/depot_tools/third_party/cq_client/validate_config.py +0 -108
- data/vendor/depot_tools/win_toolchain/toolchain2013.py +0 -494
data/vendor/depot_tools/repo
CHANGED
@@ -233,7 +233,7 @@ if (ver[0], ver[1]) < MIN_PYTHON_VERSION:
|
|
233
233
|
% sys.version.split(' ')[0], file=sys.stderr)
|
234
234
|
sys.exit(1)
|
235
235
|
|
236
|
-
home_dot_repo = os.path.expanduser('
|
236
|
+
home_dot_repo = os.path.expanduser(os.path.join('~','.repoconfig'))
|
237
237
|
gpg_dir = os.path.join(home_dot_repo, 'gnupg')
|
238
238
|
|
239
239
|
extra_args = []
|
@@ -15,10 +15,14 @@ The following hypothesis are made:
|
|
15
15
|
"""
|
16
16
|
|
17
17
|
import copy
|
18
|
+
import errno
|
18
19
|
import json
|
19
20
|
import logging
|
20
21
|
import re
|
22
|
+
import socket
|
21
23
|
import ssl
|
24
|
+
import StringIO
|
25
|
+
import sys
|
22
26
|
import time
|
23
27
|
import urllib
|
24
28
|
import urllib2
|
@@ -89,7 +93,7 @@ class Rietveld(object):
|
|
89
93
|
url = '/%d/patchset/%d/get_depends_on_patchset' % (issue, patchset)
|
90
94
|
resp = None
|
91
95
|
try:
|
92
|
-
resp = json.loads(self.
|
96
|
+
resp = json.loads(self.post(url, []))
|
93
97
|
except (urllib2.HTTPError, ValueError):
|
94
98
|
# The get_depends_on_patchset endpoint does not exist on this Rietveld
|
95
99
|
# instance yet. Ignore the error and proceed.
|
@@ -145,7 +149,7 @@ class Rietveld(object):
|
|
145
149
|
out.append(patch.FilePatchDelete(filename, state['is_binary']))
|
146
150
|
else:
|
147
151
|
content = self.get_file_content(issue, patchset, state['id'])
|
148
|
-
if not content:
|
152
|
+
if not content or content == 'None':
|
149
153
|
# As a precaution due to a bug in upload.py for git checkout, refuse
|
150
154
|
# empty files. If it's empty, it's not a binary file.
|
151
155
|
raise patch.UnsupportedPatchFormat(
|
@@ -310,7 +314,7 @@ class Rietveld(object):
|
|
310
314
|
for key in sorted(three_state_keys):
|
311
315
|
value = three_state_keys[key]
|
312
316
|
if value is not None:
|
313
|
-
url += '&%s=%
|
317
|
+
url += '&%s=%s' % (key, value)
|
314
318
|
|
315
319
|
if keys_only:
|
316
320
|
url += '&keys_only=True'
|
@@ -406,39 +410,57 @@ class Rietveld(object):
|
|
406
410
|
if m:
|
407
411
|
# Fake an HTTPError exception. Cheezy. :(
|
408
412
|
raise urllib2.HTTPError(
|
409
|
-
request_path, int(m.group(1)), msg, None,
|
413
|
+
request_path, int(m.group(1)), msg, None, StringIO.StringIO())
|
410
414
|
old_error_exit(msg)
|
411
415
|
upload.ErrorExit = trap_http_500
|
412
416
|
|
413
417
|
for retry in xrange(self._maxtries):
|
414
418
|
try:
|
415
419
|
logging.debug('%s' % request_path)
|
416
|
-
|
417
|
-
# Sometimes GAE returns a HTTP 200 but with HTTP 500 as the content.
|
418
|
-
# How nice.
|
419
|
-
return result
|
420
|
+
return self.rpc_server.Send(request_path, **kwargs)
|
420
421
|
except urllib2.HTTPError, e:
|
421
422
|
if retry >= (self._maxtries - 1):
|
422
423
|
raise
|
423
|
-
flake_codes =
|
424
|
+
flake_codes = {500, 502, 503}
|
424
425
|
if retry_on_404:
|
425
|
-
flake_codes.
|
426
|
+
flake_codes.add(404)
|
426
427
|
if e.code not in flake_codes:
|
427
428
|
raise
|
428
429
|
except urllib2.URLError, e:
|
429
430
|
if retry >= (self._maxtries - 1):
|
430
431
|
raise
|
431
|
-
|
432
|
-
|
433
|
-
#
|
432
|
+
|
433
|
+
def is_transient():
|
434
|
+
# The idea here is to retry if the error isn't permanent.
|
435
|
+
# Unfortunately, there are so many different possible errors,
|
436
|
+
# that we end up enumerating those that are known to us to be
|
437
|
+
# transient.
|
438
|
+
# The reason can be a string or another exception, e.g.,
|
439
|
+
# socket.error or whatever else.
|
440
|
+
reason_as_str = str(e.reason)
|
441
|
+
for retry_anyway in (
|
442
|
+
'Name or service not known',
|
443
|
+
'EOF occurred in violation of protocol',
|
444
|
+
'timed out',
|
445
|
+
# See http://crbug.com/601260.
|
446
|
+
'urlopen error [Errno 10060] A connection attempt failed',
|
447
|
+
'urlopen error [Errno 104] Connection reset by peer',
|
448
|
+
):
|
449
|
+
if retry_anyway in reason_as_str:
|
450
|
+
return True
|
451
|
+
return False # Assume permanent otherwise.
|
452
|
+
if not is_transient():
|
434
453
|
raise
|
435
|
-
except
|
454
|
+
except socket.error, e:
|
436
455
|
if retry >= (self._maxtries - 1):
|
437
456
|
raise
|
438
457
|
if not 'timed out' in str(e):
|
439
458
|
raise
|
440
459
|
# If reaching this line, loop again. Uses a small backoff.
|
441
460
|
time.sleep(min(10, 1+retry*2))
|
461
|
+
except urllib2.HTTPError as e:
|
462
|
+
print 'Request to %s failed: %s' % (e.geturl(), e.read())
|
463
|
+
raise
|
442
464
|
finally:
|
443
465
|
upload.ErrorExit = old_error_exit
|
444
466
|
|
@@ -508,6 +530,11 @@ class OAuthRpcServer(object):
|
|
508
530
|
payload: request is a POST if not None, GET otherwise
|
509
531
|
timeout: in seconds
|
510
532
|
extra_headers: (dict)
|
533
|
+
|
534
|
+
Returns: the HTTP response body as a string
|
535
|
+
|
536
|
+
Raises:
|
537
|
+
urllib2.HTTPError
|
511
538
|
"""
|
512
539
|
# This method signature should match upload.py:AbstractRpcServer.Send()
|
513
540
|
method = 'GET'
|
@@ -523,7 +550,6 @@ class OAuthRpcServer(object):
|
|
523
550
|
try:
|
524
551
|
if timeout:
|
525
552
|
self._http.timeout = timeout
|
526
|
-
# TODO(pgervais) implement some kind of retry mechanism (see upload.py).
|
527
553
|
url = self.host + request_path
|
528
554
|
if kwargs:
|
529
555
|
url += "?" + urllib.urlencode(kwargs)
|
@@ -552,6 +578,11 @@ class OAuthRpcServer(object):
|
|
552
578
|
continue
|
553
579
|
break
|
554
580
|
|
581
|
+
if ret[0].status >= 300:
|
582
|
+
raise urllib2.HTTPError(
|
583
|
+
request_path, int(ret[0]['status']), ret[1], None,
|
584
|
+
StringIO.StringIO())
|
585
|
+
|
555
586
|
return ret[1]
|
556
587
|
|
557
588
|
finally:
|
@@ -41,7 +41,34 @@ def is_pristine(root, merge_base='origin/master'):
|
|
41
41
|
check_output(cmd + ['--cached'], cwd=root).strip())
|
42
42
|
|
43
43
|
|
44
|
-
def
|
44
|
+
def get_log_url(upstream_url, head, master):
|
45
|
+
"""Returns an URL to read logs via a Web UI if applicable."""
|
46
|
+
if re.match(r'https://[^/]*\.googlesource\.com/', upstream_url):
|
47
|
+
# gitiles
|
48
|
+
return '%s/+log/%s..%s' % (upstream_url, head[:12], master[:12])
|
49
|
+
if upstream_url.startswith('https://github.com/'):
|
50
|
+
upstream_url = upstream_url.rstrip('/')
|
51
|
+
if upstream_url.endswith('.git'):
|
52
|
+
upstream_url = upstream_url[:-len('.git')]
|
53
|
+
return '%s/compare/%s...%s' % (upstream_url, head[:12], master[:12])
|
54
|
+
return None
|
55
|
+
|
56
|
+
|
57
|
+
def should_show_log(upstream_url):
|
58
|
+
"""Returns True if a short log should be included in the tree."""
|
59
|
+
# Skip logs for very active projects.
|
60
|
+
if upstream_url.endswith((
|
61
|
+
'/angle/angle.git',
|
62
|
+
'/catapult-project/catapult.git',
|
63
|
+
'/v8/v8.git')):
|
64
|
+
return False
|
65
|
+
if 'webrtc' in upstream_url:
|
66
|
+
return False
|
67
|
+
return True
|
68
|
+
|
69
|
+
|
70
|
+
def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit,
|
71
|
+
ignore_dirty_tree=False):
|
45
72
|
deps = os.path.join(root, 'DEPS')
|
46
73
|
try:
|
47
74
|
with open(deps, 'rb') as f:
|
@@ -50,12 +77,12 @@ def roll(root, deps_dir, key, reviewers, bug):
|
|
50
77
|
raise Error('Ensure the script is run in the directory '
|
51
78
|
'containing DEPS file.')
|
52
79
|
|
53
|
-
if not is_pristine(root):
|
54
|
-
raise Error('Ensure %s is clean first.' % root)
|
80
|
+
if not ignore_dirty_tree and not is_pristine(root):
|
81
|
+
raise Error('Ensure %s is clean first (no non-merged commits).' % root)
|
55
82
|
|
56
83
|
full_dir = os.path.normpath(os.path.join(os.path.dirname(root), deps_dir))
|
57
84
|
if not os.path.isdir(full_dir):
|
58
|
-
raise Error('Directory not found: %s' % deps_dir)
|
85
|
+
raise Error('Directory not found: %s (%s)' % (deps_dir, full_dir))
|
59
86
|
head = check_output(['git', 'rev-parse', 'HEAD'], cwd=full_dir).strip()
|
60
87
|
|
61
88
|
if not head in deps_content:
|
@@ -68,7 +95,7 @@ def roll(root, deps_dir, key, reviewers, bug):
|
|
68
95
|
# It happens if the user checked out a branch in the dependency by himself.
|
69
96
|
# Fall back to reading the DEPS to figure out the original commit.
|
70
97
|
for i in deps_content.splitlines():
|
71
|
-
m = re.match(r'\s+"' + key + '"
|
98
|
+
m = re.match(r'\s+"' + key + '":.*"([a-z0-9]{40})",', i)
|
72
99
|
if m:
|
73
100
|
head = m.group(1)
|
74
101
|
break
|
@@ -77,44 +104,61 @@ def roll(root, deps_dir, key, reviewers, bug):
|
|
77
104
|
|
78
105
|
print('Found old revision %s' % head)
|
79
106
|
|
80
|
-
check_call(['git', 'fetch', 'origin'], cwd=full_dir)
|
81
|
-
|
82
|
-
|
83
|
-
print('Found new revision %s' % master)
|
107
|
+
check_call(['git', 'fetch', 'origin', '--quiet'], cwd=full_dir)
|
108
|
+
roll_to = check_output(['git', 'rev-parse', roll_to], cwd=full_dir).strip()
|
109
|
+
print('Found new revision %s' % roll_to)
|
84
110
|
|
85
|
-
if
|
111
|
+
if roll_to == head:
|
86
112
|
raise Error('No revision to roll!')
|
87
113
|
|
88
|
-
commit_range = '%s..%s' % (head[:9],
|
114
|
+
commit_range = '%s..%s' % (head[:9], roll_to[:9])
|
89
115
|
|
116
|
+
upstream_url = check_output(
|
117
|
+
['git', 'config', 'remote.origin.url'], cwd=full_dir).strip()
|
118
|
+
log_url = get_log_url(upstream_url, head, roll_to)
|
119
|
+
cmd = [
|
120
|
+
'git', 'log', commit_range, '--date=short', '--no-merges',
|
121
|
+
]
|
90
122
|
logs = check_output(
|
91
|
-
|
92
|
-
cwd=full_dir)
|
123
|
+
cmd + ['--format=%ad %ae %s'], # Args with '=' are automatically quoted.
|
124
|
+
cwd=full_dir)
|
93
125
|
logs = re.sub(r'(?m)^(\d\d\d\d-\d\d-\d\d [^@]+)@[^ ]+( .*)$', r'\1\2', logs)
|
94
|
-
|
126
|
+
nb_commits = logs.count('\n')
|
127
|
+
|
128
|
+
header = 'Roll %s/ %s (%d commit%s).\n\n' % (
|
129
|
+
deps_dir,
|
130
|
+
commit_range,
|
131
|
+
nb_commits,
|
132
|
+
's' if nb_commits > 1 else '')
|
133
|
+
|
134
|
+
log_section = ''
|
135
|
+
if log_url:
|
136
|
+
log_section = log_url + '\n\n'
|
137
|
+
log_section += '$ %s ' % ' '.join(cmd)
|
138
|
+
log_section += '--format=\'%ad %ae %s\'\n'
|
139
|
+
if not no_log and should_show_log(upstream_url):
|
140
|
+
if logs.count('\n') > log_limit:
|
141
|
+
# Keep the first N log entries.
|
142
|
+
logs = ''.join(logs.splitlines(True)[:log_limit]) + '(...)\n'
|
143
|
+
log_section += logs
|
144
|
+
log_section += '\n'
|
145
|
+
|
95
146
|
reviewer = 'R=%s\n' % ','.join(reviewers) if reviewers else ''
|
96
147
|
bug = 'BUG=%s\n' % bug if bug else ''
|
97
|
-
msg =
|
98
|
-
'Roll %s/ to %s.\n'
|
99
|
-
'\n'
|
100
|
-
'$ %s\n'
|
101
|
-
'%s\n\n'
|
102
|
-
'%s'
|
103
|
-
'%s') % (
|
104
|
-
deps_dir,
|
105
|
-
master,
|
106
|
-
cmd,
|
107
|
-
logs,
|
108
|
-
reviewer,
|
109
|
-
bug)
|
148
|
+
msg = header + log_section + reviewer + bug
|
110
149
|
|
111
150
|
print('Commit message:')
|
112
151
|
print('\n'.join(' ' + i for i in msg.splitlines()))
|
113
|
-
deps_content = deps_content.replace(head,
|
152
|
+
deps_content = deps_content.replace(head, roll_to)
|
114
153
|
with open(deps, 'wb') as f:
|
115
154
|
f.write(deps_content)
|
116
155
|
check_call(['git', 'add', 'DEPS'], cwd=root)
|
117
|
-
check_call(['git', 'commit', '-m', msg], cwd=root)
|
156
|
+
check_call(['git', 'commit', '--quiet', '-m', msg], cwd=root)
|
157
|
+
|
158
|
+
# Pull the dependency to the right revision. This is surprising to users
|
159
|
+
# otherwise.
|
160
|
+
check_call(['git', 'checkout', '--quiet', roll_to], cwd=full_dir)
|
161
|
+
|
118
162
|
print('')
|
119
163
|
if not reviewers:
|
120
164
|
print('You forgot to pass -r, make sure to insert a R=foo@example.com line')
|
@@ -126,13 +170,26 @@ def roll(root, deps_dir, key, reviewers, bug):
|
|
126
170
|
|
127
171
|
def main():
|
128
172
|
parser = argparse.ArgumentParser(description=__doc__)
|
129
|
-
parser.add_argument(
|
173
|
+
parser.add_argument(
|
174
|
+
'--ignore-dirty-tree', action='store_true',
|
175
|
+
help='Roll anyways, even if there is a diff.')
|
176
|
+
parser.add_argument(
|
177
|
+
'-r', '--reviewer',
|
130
178
|
help='To specify multiple reviewers, use comma separated list, e.g. '
|
131
179
|
'-r joe,jane,john. Defaults to @chromium.org')
|
132
|
-
parser.add_argument('-b', '--bug')
|
133
|
-
parser.add_argument(
|
180
|
+
parser.add_argument('-b', '--bug', help='Associate a bug number to the roll')
|
181
|
+
parser.add_argument(
|
182
|
+
'--no-log', action='store_true',
|
183
|
+
help='Do not include the short log in the commit message')
|
184
|
+
parser.add_argument(
|
185
|
+
'--log-limit', type=int, default=100,
|
186
|
+
help='Trim log after N commits (default: %(default)s)')
|
187
|
+
parser.add_argument(
|
188
|
+
'--roll-to', default='origin/master',
|
189
|
+
help='Specify the new commit to roll to (default: %(default)s)')
|
190
|
+
parser.add_argument('dep_path', help='Path to dependency')
|
134
191
|
parser.add_argument('key', nargs='?',
|
135
|
-
help='
|
192
|
+
help='Regexp for dependency in DEPS file')
|
136
193
|
args = parser.parse_args()
|
137
194
|
|
138
195
|
reviewers = None
|
@@ -145,10 +202,14 @@ def main():
|
|
145
202
|
try:
|
146
203
|
roll(
|
147
204
|
os.getcwd(),
|
148
|
-
args.dep_path,
|
205
|
+
args.dep_path.rstrip('/').rstrip('\\'),
|
206
|
+
args.roll_to,
|
149
207
|
args.key,
|
150
|
-
reviewers
|
151
|
-
|
208
|
+
reviewers,
|
209
|
+
args.bug,
|
210
|
+
args.no_log,
|
211
|
+
args.log_limit,
|
212
|
+
args.ignore_dirty_tree)
|
152
213
|
|
153
214
|
except Error as e:
|
154
215
|
sys.stderr.write('error: %s\n' % e)
|
data/vendor/depot_tools/scm.py
CHANGED
@@ -1040,10 +1040,10 @@ class SVN(object):
|
|
1040
1040
|
auth_dir = os.path.join(os.environ['APPDATA'], 'Subversion', 'auth',
|
1041
1041
|
'svn.simple')
|
1042
1042
|
else:
|
1043
|
-
|
1043
|
+
auth_dir = os.path.expanduser(
|
1044
|
+
os.path.join('~', '.subversion', 'auth', 'svn.simple'))
|
1045
|
+
if not os.path.exists(auth_dir):
|
1044
1046
|
return None
|
1045
|
-
auth_dir = os.path.join(os.environ['HOME'], '.subversion', 'auth',
|
1046
|
-
'svn.simple')
|
1047
1047
|
for credfile in os.listdir(auth_dir):
|
1048
1048
|
cred_info = SVN.ReadSimpleAuth(os.path.join(auth_dir, credfile))
|
1049
1049
|
if regexp.match(cred_info.get('svn:realmstring')):
|
@@ -0,0 +1,94 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
3
|
+
# Use of this source code is governed by a BSD-style license that can be
|
4
|
+
# found in the LICENSE file.
|
5
|
+
|
6
|
+
import os
|
7
|
+
import sys
|
8
|
+
from third_party import colorama
|
9
|
+
|
10
|
+
IS_TTY = None
|
11
|
+
OUT_TYPE = 'unknown'
|
12
|
+
|
13
|
+
def init():
|
14
|
+
# should_wrap instructs colorama to wrap stdout/stderr with an ASNI colorcode
|
15
|
+
# interpreter that converts them to SetConsoleTextAttribute calls. This only
|
16
|
+
# should be True in cases where we're connected to cmd.exe's console. Setting
|
17
|
+
# this to True on non-windows systems has no effect.
|
18
|
+
should_wrap = False
|
19
|
+
global IS_TTY, OUT_TYPE
|
20
|
+
IS_TTY = sys.stdout.isatty()
|
21
|
+
if IS_TTY:
|
22
|
+
# Yay! We detected a console in the normal way. It doesn't really matter
|
23
|
+
# if it's windows or not, we win.
|
24
|
+
OUT_TYPE = 'console'
|
25
|
+
should_wrap = True
|
26
|
+
elif sys.platform.startswith('win'):
|
27
|
+
# assume this is some sort of file
|
28
|
+
OUT_TYPE = 'file (win)'
|
29
|
+
|
30
|
+
import msvcrt
|
31
|
+
import ctypes
|
32
|
+
h = msvcrt.get_osfhandle(sys.stdout.fileno())
|
33
|
+
# h is the win32 HANDLE for stdout.
|
34
|
+
ftype = ctypes.windll.kernel32.GetFileType(h)
|
35
|
+
if ftype == 2: # FILE_TYPE_CHAR
|
36
|
+
# This is a normal cmd console, but we'll only get here if we're running
|
37
|
+
# inside a `git command` which is actually git->bash->command. Not sure
|
38
|
+
# why isatty doesn't detect this case.
|
39
|
+
OUT_TYPE = 'console (cmd via msys)'
|
40
|
+
IS_TTY = True
|
41
|
+
should_wrap = True
|
42
|
+
elif ftype == 3: # FILE_TYPE_PIPE
|
43
|
+
OUT_TYPE = 'pipe (win)'
|
44
|
+
# This is some kind of pipe on windows. This could either be a real pipe
|
45
|
+
# or this could be msys using a pipe to emulate a pty. We use the same
|
46
|
+
# algorithm that msys-git uses to determine if it's connected to a pty or
|
47
|
+
# not.
|
48
|
+
|
49
|
+
# This function and the structures are defined in the MSDN documentation
|
50
|
+
# using the same names.
|
51
|
+
def NT_SUCCESS(status):
|
52
|
+
# The first two bits of status are the severity. The success
|
53
|
+
# severities are 0 and 1, and the !success severities are 2 and 3.
|
54
|
+
# Therefore since ctypes interprets the default restype of the call
|
55
|
+
# to be an 'C int' (which is guaranteed to be signed 32 bits), All
|
56
|
+
# success codes are positive, and all !success codes are negative.
|
57
|
+
return status >= 0
|
58
|
+
|
59
|
+
class UNICODE_STRING(ctypes.Structure):
|
60
|
+
_fields_ = [('Length', ctypes.c_ushort),
|
61
|
+
('MaximumLength', ctypes.c_ushort),
|
62
|
+
('Buffer', ctypes.c_wchar_p)]
|
63
|
+
|
64
|
+
class OBJECT_NAME_INFORMATION(ctypes.Structure):
|
65
|
+
_fields_ = [('Name', UNICODE_STRING),
|
66
|
+
('NameBuffer', ctypes.c_wchar_p)]
|
67
|
+
|
68
|
+
buf = ctypes.create_string_buffer('\0', 1024)
|
69
|
+
# Ask NT what the name of the object our stdout HANDLE is. It would be
|
70
|
+
# possible to use GetFileInformationByHandleEx, but it's only available
|
71
|
+
# on Vista+. If you're reading this in 2017 or later, feel free to
|
72
|
+
# refactor this out.
|
73
|
+
#
|
74
|
+
# The '1' here is ObjectNameInformation
|
75
|
+
if NT_SUCCESS(ctypes.windll.ntdll.NtQueryObject(h, 1, buf, len(buf)-2,
|
76
|
+
None)):
|
77
|
+
out = OBJECT_NAME_INFORMATION.from_buffer(buf)
|
78
|
+
name = out.Name.Buffer.split('\\')[-1]
|
79
|
+
IS_TTY = name.startswith('msys-') and '-pty' in name
|
80
|
+
if IS_TTY:
|
81
|
+
OUT_TYPE = 'bash (msys)'
|
82
|
+
else:
|
83
|
+
# A normal file, or an unknown file type.
|
84
|
+
pass
|
85
|
+
else:
|
86
|
+
# This is non-windows, so we trust isatty.
|
87
|
+
OUT_TYPE = 'pipe or file'
|
88
|
+
|
89
|
+
colorama.init(wrap=should_wrap)
|
90
|
+
|
91
|
+
if __name__ == '__main__':
|
92
|
+
init()
|
93
|
+
print 'IS_TTY:', IS_TTY
|
94
|
+
print 'OUT_TYPE:', OUT_TYPE
|