media/webrtc/trunk/tools/clang/scripts/update.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #!/usr/bin/env python
     2 # Copyright (c) 2012 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.
     6 """Windows can't run .sh files, so this is a small python wrapper around
     7 update.sh.
     8 """
    10 import os
    11 import subprocess
    12 import sys
    15 def main():
    16   if sys.platform in ['win32', 'cygwin']:
    17     return 0
    19   # This script is called by gclient. gclient opens its hooks subprocesses with
    20   # (stdout=subprocess.PIPE, stderr=subprocess.STDOUT) and then does custom
    21   # output processing that breaks printing '\r' characters for single-line
    22   # updating status messages as printed by curl and wget.
    23   # Work around this by setting stderr of the update.sh process to stdin (!):
    24   # gclient doesn't redirect stdin, and while stdin itself is read-only, a
    25   # dup()ed sys.stdin is writable, try
    26   #   fd2 = os.dup(sys.stdin.fileno()); os.write(fd2, 'hi')
    27   # TODO: Fix gclient instead, http://crbug.com/95350
    28   return subprocess.call(
    29       [os.path.join(os.path.dirname(__file__), 'update.sh')] +  sys.argv[1:],
    30       stderr=os.fdopen(os.dup(sys.stdin.fileno())))
    33 if __name__ == '__main__':
    34   sys.exit(main())

mercurial