[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Wed Apr 7 23:58:34 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 4fe23602d936df5d21b5a05284df78305f0f88ec
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 27 07:56:51 2009 +0000

    2009-11-26  Adam Barth  <abarth at 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:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51435 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index dc00718..81ff87f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -5,6 +5,19 @@
         [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:
+
+2009-11-26  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [bzt] Kill WebKitLandingScripts
+        https://bugs.webkit.org/show_bug.cgi?id=31904
+
         Step 4: Kill run_webkit_script.
 
         * Scripts/modules/buildsteps.py:
diff --git a/WebKitTools/Scripts/modules/buildsteps.py b/WebKitTools/Scripts/modules/buildsteps.py
index 13a5777..07dc63d 100644
--- a/WebKitTools/Scripts/modules/buildsteps.py
+++ b/WebKitTools/Scripts/modules/buildsteps.py
@@ -29,13 +29,14 @@
 import os
 
 from modules.logging import log, error
+from modules.processutils import run_and_throw_if_fail
 from modules.webkitlandingscripts import WebKitLandingScripts
 from modules.webkitport import WebKitPort
 
 class BuildSteps:
     def _run_script(cls, script_name, quiet=False, port=WebKitPort):
         log("Running %s" % script_name)
-        WebKitLandingScripts.run_and_throw_if_fail(port.script_path(script_name), quiet)
+        run_and_throw_if_fail(port.script_path(script_name), quiet)
 
     def prepare_changelog(self):
         self.run_script("prepare-ChangeLog")
@@ -55,7 +56,7 @@ class BuildSteps:
             args.append("--quiet")
         if fail_fast:
             args.append("--exit-after-n-failures=1")
-        WebKitLandingScripts.run_and_throw_if_fail(args)
+        run_and_throw_if_fail(args)
 
     def ensure_builders_are_green(self, buildbot, options):
         if not options.check_builders or buildbot.core_builders_are_green():
@@ -64,7 +65,7 @@ class BuildSteps:
 
     def build_webkit(self, quiet=False, port=WebKitPort):
         log("Building WebKit")
-        WebKitLandingScripts.run_and_throw_if_fail(port.build_webkit_command(), quiet)
+        run_and_throw_if_fail(port.build_webkit_command(), quiet)
 
     def check_style(self):
         self._run_script("check-webkit-style")
diff --git a/WebKitTools/Scripts/modules/commands/queues.py b/WebKitTools/Scripts/modules/commands/queues.py
index 27c4be8..1f02e61 100644
--- a/WebKitTools/Scripts/modules/commands/queues.py
+++ b/WebKitTools/Scripts/modules/commands/queues.py
@@ -48,9 +48,9 @@ from modules.landingsequence import LandingSequence, ConditionalLandingSequence
 from modules.logging import error, log, tee
 from modules.multicommandtool import MultiCommandTool, Command
 from modules.patchcollection import PatchCollection
+from modules.processutils import run_and_throw_if_fail
 from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
 from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
 from modules.webkitport import WebKitPort
 from modules.workqueue import WorkQueue, WorkQueueDelegate
 
@@ -96,7 +96,7 @@ class AbstractQueue(Command, WorkQueueDelegate):
 
     def run_bugzilla_tool(self, args):
         bugzilla_tool_args = [self.tool.path()] + args
-        WebKitLandingScripts.run_and_throw_if_fail(bugzilla_tool_args)
+        run_and_throw_if_fail(bugzilla_tool_args)
 
     def log_progress(self, patch_ids):
         log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(patch_ids)))
diff --git a/WebKitTools/Scripts/modules/processutils.py b/WebKitTools/Scripts/modules/processutils.py
new file mode 100644
index 0000000..68cf215
--- /dev/null
+++ b/WebKitTools/Scripts/modules/processutils.py
@@ -0,0 +1,63 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+# 
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import StringIO
+import subprocess
+import sys
+
+from modules.logging import tee
+from modules.scm import ScriptError
+
+def run_command_with_teed_output(args, teed_output):
+    child_process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+    # Use our own custom wait loop because Popen ignores a tee'd stderr/stdout.
+    # FIXME: This could be improved not to flatten output to stdout.
+    while True:
+        output_line = child_process.stdout.readline()
+        if output_line == "" and child_process.poll() != None:
+            return child_process.poll()
+        teed_output.write(output_line)
+
+def run_and_throw_if_fail(args, quiet=False):
+    # Cache the child's output locally so it can be used for error reports.
+    child_out_file = StringIO.StringIO()
+    if quiet:
+        dev_null = open(os.devnull, "w")
+    child_stdout = tee(child_out_file, dev_null if quiet else sys.stdout)
+    exit_code = run_command_with_teed_output(args, child_stdout)
+    if quiet:
+        dev_null.close()
+
+    child_output = child_out_file.getvalue()
+    child_out_file.close()
+
+    if exit_code:
+        raise ScriptError(script_args=args, exit_code=exit_code, output=child_output)
diff --git a/WebKitTools/Scripts/modules/webkitlandingscripts.py b/WebKitTools/Scripts/modules/webkitlandingscripts.py
index 2493593..96aa47b 100644
--- a/WebKitTools/Scripts/modules/webkitlandingscripts.py
+++ b/WebKitTools/Scripts/modules/webkitlandingscripts.py
@@ -84,34 +84,6 @@ class WebKitLandingScripts:
             make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing."),
         ]
 
-    @staticmethod
-    def run_command_with_teed_output(args, teed_output):
-        child_process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-        # Use our own custom wait loop because Popen ignores a tee'd stderr/stdout.
-        # FIXME: This could be improved not to flatten output to stdout.
-        while True:
-            output_line = child_process.stdout.readline()
-            if output_line == "" and child_process.poll() != None:
-                return child_process.poll()
-            teed_output.write(output_line)
-
-    @staticmethod
-    def run_and_throw_if_fail(args, quiet=False):
-        # Cache the child's output locally so it can be used for error reports.
-        child_out_file = StringIO.StringIO()
-        if quiet:
-            dev_null = open(os.devnull, "w")
-        child_stdout = tee(child_out_file, dev_null if quiet else sys.stdout)
-        exit_code = WebKitLandingScripts.run_command_with_teed_output(args, child_stdout)
-        if quiet:
-            dev_null.close()
-
-        child_output = child_out_file.getvalue()
-        child_out_file.close()
-
-        if exit_code:
-            raise ScriptError(script_args=args, exit_code=exit_code, output=child_output)
 
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list