https://bugs.webkit.org/show_bug.cgi?id=73230
Reviewed by Adam Barth.
This makes it less likely for gclient changes to break the bots (e.g.,
if a DEPS repository moves or is switched to a branch).
Also pass --force when using |build-webkit --update-chromium| since this
appears to only be used by the bots.
Take 2: Add Options.non_interactive to update.py's options() method.
* Scripts/update-webkit:
* Scripts/webkitdirs.pm:
(determineIsChromium): Add --force-update to update-webkit --chromium.
(forceChromiumUpdate):
(buildChromium): Pass --force to update-webkit-chromium.
* Scripts/webkitpy/tool/steps/update.py:
(Update.run): Add --force-update if non-interactive (i.e., bots).
* Scripts/webkitpy/tool/steps/update_unittest.py:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101285
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2011-11-28 Tony Chang <tony@chromium.org>
+ ews bots should pass --force to update-webkit-chromium
+ https://bugs.webkit.org/show_bug.cgi?id=73230
+
+ Reviewed by Adam Barth.
+
+ This makes it less likely for gclient changes to break the bots (e.g.,
+ if a DEPS repository moves or is switched to a branch).
+
+ Also pass --force when using |build-webkit --update-chromium| since this
+ appears to only be used by the bots.
+
+ Take 2: Add Options.non_interactive to update.py's options() method.
+
+ * Scripts/update-webkit:
+ * Scripts/webkitdirs.pm:
+ (determineIsChromium): Add --force-update to update-webkit --chromium.
+ (forceChromiumUpdate):
+ (buildChromium): Pass --force to update-webkit-chromium.
+ * Scripts/webkitpy/tool/steps/update.py:
+ (Update.run): Add --force-update if non-interactive (i.e., bots).
+ * Scripts/webkitpy/tool/steps/update_unittest.py:
+
+2011-11-28 Tony Chang <tony@chromium.org>
+
Revert r101279, broke the ews and cq bots.
* Scripts/update-webkit:
my @chromiumUpdateArgs = ("perl", "Tools/Scripts/update-webkit-chromium");
push @chromiumUpdateArgs, "--chromium-android" if isChromiumAndroid();
+ push @chromiumUpdateArgs, "--force" if forceChromiumUpdate();
system(@chromiumUpdateArgs) == 0 or die $!;
} elsif (isAppleWinWebKit()) {
system("perl", "Tools/Scripts/update-webkit-auxiliary-libs") == 0 or die;
my $isChromium;
my $isChromiumAndroid;
my $isChromiumMacMake;
+my $forceChromiumUpdate;
my $isInspectorFrontend;
my $isWK2;
{
return if defined($isChromium);
$isChromium = checkForArgumentAndRemoveFromARGV("--chromium");
+ if ($isChromium) {
+ $forceChromiumUpdate = checkForArgumentAndRemoveFromARGV("--force-update");
+ }
}
sub isChromiumAndroid()
$isChromiumMacMake = isDarwin() && $hasUpToDateMakefile;
}
+sub forceChromiumUpdate()
+{
+ determineIsChromium();
+ return $forceChromiumUpdate;
+}
sub isWinCairo()
{
# We might need to update DEPS or re-run GYP if things have changed.
if (checkForArgumentAndRemoveFromArrayRef("--update-chromium", \@options)) {
- system("perl", "Tools/Scripts/update-webkit-chromium") == 0 or die $!;
+ system("perl", "Tools/Scripts/update-webkit-chromium", "--force") == 0 or die $!;
}
my $result = 1;
raise NotImplementedError("subclasses must implement")
@classmethod
- def update_webkit_command(cls):
+ def update_webkit_command(cls, non_interactive=False):
return cls.script_shell_command("update-webkit")
@classmethod
return "--port=chromium"
@classmethod
- def update_webkit_command(cls):
- command = WebKitPort.update_webkit_command()
+ def update_webkit_command(cls, non_interactive=False):
+ command = WebKitPort.update_webkit_command(non_interactive=non_interactive)
command.append("--chromium")
+ if non_interactive:
+ command.append("--force-update")
return command
@classmethod
def check_webkit_style_command(self):
return ["mock-check-webkit-style"]
- def update_webkit_command(self):
+ def update_webkit_command(self, non_interactive=False):
return ["mock-update-webkit"]
def build_webkit_command(self, build_style=None):
@classmethod
def options(cls):
return AbstractStep.options() + [
+ Options.non_interactive,
Options.update,
Options.quiet,
]
if not self._options.update:
return
log("Updating working directory")
- self._tool.executive.run_and_throw_if_fail(self._tool.port().update_webkit_command(), quiet=self._options.quiet, cwd=self._tool.scm().checkout_root)
+ self._tool.executive.run_and_throw_if_fail(self._update_command(), quiet=self._options.quiet, cwd=self._tool.scm().checkout_root)
+
+ def _update_command(self):
+ update_command = self._tool.port().update_webkit_command(self._options.non_interactive)
+ return update_command
--- /dev/null
+# Copyright (C) 2011 Google 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 unittest
+
+from webkitpy.common.config.ports import ChromiumPort, ChromiumXVFBPort
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.update import Update
+
+
+class UpdateTest(unittest.TestCase):
+
+ def test_update_command_non_interactive(self):
+ tool = MockTool()
+ options = MockOptions(non_interactive=True)
+ step = Update(tool, options)
+ self.assertEqual(["mock-update-webkit"], step._update_command())
+
+ tool._deprecated_port = ChromiumPort()
+ self.assertEqual(["Tools/Scripts/update-webkit", "--chromium", "--force-update"], step._update_command())
+
+ tool._deprecated_port = ChromiumXVFBPort()
+ self.assertEqual(["Tools/Scripts/update-webkit", "--chromium", "--force-update"], step._update_command())
+
+ def test_update_command_interactive(self):
+ tool = MockTool()
+ options = MockOptions(non_interactive=False)
+ step = Update(tool, options)
+ self.assertEqual(["mock-update-webkit"], step._update_command())
+
+ tool._deprecated_port = ChromiumPort()
+ self.assertEqual(["Tools/Scripts/update-webkit", "--chromium"], step._update_command())
+
+ tool._deprecated_port = ChromiumXVFBPort()
+ self.assertEqual(["Tools/Scripts/update-webkit", "--chromium"], step._update_command())