diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/libwebrtc/tools/clang/scripts/update.py | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/tools/clang/scripts/update.py')
-rwxr-xr-x | third_party/libwebrtc/tools/clang/scripts/update.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/third_party/libwebrtc/tools/clang/scripts/update.py b/third_party/libwebrtc/tools/clang/scripts/update.py new file mode 100755 index 0000000000..bdc781f715 --- /dev/null +++ b/third_party/libwebrtc/tools/clang/scripts/update.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Windows can't run .sh files, so this is a small python wrapper around +update.sh. +""" + +import os +import subprocess +import sys + + +def main(): + if sys.platform in ['win32', 'cygwin']: + return 0 + + # This script is called by gclient. gclient opens its hooks subprocesses with + # (stdout=subprocess.PIPE, stderr=subprocess.STDOUT) and then does custom + # output processing that breaks printing '\r' characters for single-line + # updating status messages as printed by curl and wget. + # Work around this by setting stderr of the update.sh process to stdin (!): + # gclient doesn't redirect stdin, and while stdin itself is read-only, a + # dup()ed sys.stdin is writable, try + # fd2 = os.dup(sys.stdin.fileno()); os.write(fd2, 'hi') + # TODO: Fix gclient instead, http://crbug.com/95350 + return subprocess.call( + [os.path.join(os.path.dirname(__file__), 'update.sh')] + sys.argv[1:], + stderr=os.fdopen(os.dup(sys.stdin.fileno()))) + + +if __name__ == '__main__': + sys.exit(main()) |