2009-06-25 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jun 2009 21:52:21 +0000 (21:52 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jun 2009 21:52:21 +0000 (21:52 +0000)
        Reviewed by Mark Rowe.

        Call WebKitTools/Scripts scripts by their absolute paths
        https://bugs.webkit.org/show_bug.cgi?id=26704

        bugzilla-tool used to use whatever build-webkit was in your path.
        That could end up building the wrong copy of WebKit.

        * Scripts/bugzilla-tool:
        * Scripts/modules/scm.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45197 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/bugzilla-tool
WebKitTools/Scripts/modules/scm.py

index 19c0610..3a3d853 100644 (file)
@@ -1,3 +1,16 @@
+2009-06-25  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Mark Rowe.
+
+        Call WebKitTools/Scripts scripts by their absolute paths
+        https://bugs.webkit.org/show_bug.cgi?id=26704
+
+        bugzilla-tool used to use whatever build-webkit was in your path.
+        That could end up building the wrong copy of WebKit.
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/scm.py:
+
 2009-06-25  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         Reviewed by Dave Levin.
index 5204acf..99b1d36 100755 (executable)
@@ -235,18 +235,23 @@ class LandPatchesFromBugs(Command):
 
     @staticmethod
     def run_and_throw_if_fail(script_name):
-        build_webkit_process = subprocess.Popen(script_name, shell=True)
+        build_webkit_process = subprocess.Popen(script_name)
         return_code = build_webkit_process.wait()
         if return_code:
             raise ScriptError("%s failed with exit code %d" % (script_name, return_code))
 
     @classmethod
+    def run_webkit_script(cls, script_name):
+        # We might need to pass scm into this function for scm.checkout_root
+        cls.run_and_throw_if_fail(os.path.join("WebKitTools", "Scripts", script_name))
+
+    @classmethod
     def build_webkit(cls):
-        cls.run_and_throw_if_fail("build-webkit")
+        cls.run_webkit_script("build-webkit")
 
     @classmethod
     def run_webkit_tests(cls):
-        cls.run_and_throw_if_fail("run-webkit-tests")
+        cls.run_webkit_script("run-webkit-tests")
 
     @staticmethod
     def setup_for_landing(scm, options):
index dc8a6d3..f0c7bfa 100644 (file)
@@ -70,6 +70,9 @@ class SCM:
             return exit_code
         return output
 
+    def script_path(self, script_name):
+        return os.path.join(self.checkout_root, "WebKitTools", "Scripts", script_name)
+
     def ensure_clean_working_directory(self, force):
         if not force and not self.working_directory_is_clean():
             print self.run_command(self.status_command(), raise_on_failure=False)
@@ -92,7 +95,7 @@ class SCM:
         # It's possible that the patch was not made from the root directory.
         # We should detect and handle that case.
         curl_process = subprocess.Popen(['curl', patch['url']], stdout=subprocess.PIPE)
-        patch_apply_process = subprocess.Popen(['svn-apply', '--reviewer', patch['reviewer']], stdin=curl_process.stdout)
+        patch_apply_process = subprocess.Popen([self.script_path('svn-apply'), '--reviewer', patch['reviewer']], stdin=curl_process.stdout)
 
         return_code = patch_apply_process.wait()
         if return_code:
@@ -188,7 +191,7 @@ class SVN(SCM):
         self.run_command("svn reset -R")
 
     def update_webkit(self):
-        self.run_command("update-webkit")
+        self.run_command(self.script_path("update-webkit"))
 
     def status_command(self):
         return 'svn status'
@@ -207,7 +210,7 @@ class SVN(SCM):
         return "svn"
 
     def create_patch_command(self):
-        return "svn-create-patch"
+        return self.script_path("svn-create-patch")
 
     def commit_with_message(self, message):
         if self.dryrun: