Changeset 51435 in webkit


Ignore:
Timestamp:
Nov 26, 2009 11:56:51 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2009-11-26 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

[bzt] Kill WebKitLandingScripts
https://bugs.webkit.org/show_bug.cgi?id=31904

Step 5: Kill run_and_throw_if_fail.

  • Scripts/modules/buildsteps.py:
  • Scripts/modules/processutils.py: Added.
  • Scripts/modules/webkitlandingscripts.py:
Location:
trunk/WebKitTools
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51434 r51435  
     12009-11-26  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [bzt] Kill WebKitLandingScripts
     6        https://bugs.webkit.org/show_bug.cgi?id=31904
     7
     8        Step 5: Kill run_and_throw_if_fail.
     9
     10        * Scripts/modules/buildsteps.py:
     11        * Scripts/modules/processutils.py: Added.
     12        * Scripts/modules/webkitlandingscripts.py:
     13
    1142009-11-26  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebKitTools/Scripts/modules/buildsteps.py

    r51434 r51435  
    3030
    3131from modules.logging import log, error
     32from modules.processutils import run_and_throw_if_fail
    3233from modules.webkitlandingscripts import WebKitLandingScripts
    3334from modules.webkitport import WebKitPort
     
    3637    def _run_script(cls, script_name, quiet=False, port=WebKitPort):
    3738        log("Running %s" % script_name)
    38         WebKitLandingScripts.run_and_throw_if_fail(port.script_path(script_name), quiet)
     39        run_and_throw_if_fail(port.script_path(script_name), quiet)
    3940
    4041    def prepare_changelog(self):
     
    5657        if fail_fast:
    5758            args.append("--exit-after-n-failures=1")
    58         WebKitLandingScripts.run_and_throw_if_fail(args)
     59        run_and_throw_if_fail(args)
    5960
    6061    def ensure_builders_are_green(self, buildbot, options):
     
    6566    def build_webkit(self, quiet=False, port=WebKitPort):
    6667        log("Building WebKit")
    67         WebKitLandingScripts.run_and_throw_if_fail(port.build_webkit_command(), quiet)
     68        run_and_throw_if_fail(port.build_webkit_command(), quiet)
    6869
    6970    def check_style(self):
  • trunk/WebKitTools/Scripts/modules/commands/queues.py

    r51403 r51435  
    4949from modules.multicommandtool import MultiCommandTool, Command
    5050from modules.patchcollection import PatchCollection
     51from modules.processutils import run_and_throw_if_fail
    5152from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
    5253from modules.statusbot import StatusBot
    53 from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
    5454from modules.webkitport import WebKitPort
    5555from modules.workqueue import WorkQueue, WorkQueueDelegate
     
    9797    def run_bugzilla_tool(self, args):
    9898        bugzilla_tool_args = [self.tool.path()] + args
    99         WebKitLandingScripts.run_and_throw_if_fail(bugzilla_tool_args)
     99        run_and_throw_if_fail(bugzilla_tool_args)
    100100
    101101    def log_progress(self, patch_ids):
  • trunk/WebKitTools/Scripts/modules/webkitlandingscripts.py

    r51434 r51435  
    8585        ]
    8686
    87     @staticmethod
    88     def run_command_with_teed_output(args, teed_output):
    89         child_process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    90 
    91         # Use our own custom wait loop because Popen ignores a tee'd stderr/stdout.
    92         # FIXME: This could be improved not to flatten output to stdout.
    93         while True:
    94             output_line = child_process.stdout.readline()
    95             if output_line == "" and child_process.poll() != None:
    96                 return child_process.poll()
    97             teed_output.write(output_line)
    98 
    99     @staticmethod
    100     def run_and_throw_if_fail(args, quiet=False):
    101         # Cache the child's output locally so it can be used for error reports.
    102         child_out_file = StringIO.StringIO()
    103         if quiet:
    104             dev_null = open(os.devnull, "w")
    105         child_stdout = tee(child_out_file, dev_null if quiet else sys.stdout)
    106         exit_code = WebKitLandingScripts.run_command_with_teed_output(args, child_stdout)
    107         if quiet:
    108             dev_null.close()
    109 
    110         child_output = child_out_file.getvalue()
    111         child_out_file.close()
    112 
    113         if exit_code:
    114             raise ScriptError(script_args=args, exit_code=exit_code, output=child_output)
    11587
    11688
Note: See TracChangeset for help on using the changeset viewer.