Title: [168711] releases/WebKitGTK/webkit-2.4/Tools
Revision
168711
Author
g...@gnome.org
Date
2014-05-13 12:29:34 -0700 (Tue, 13 May 2014)

Log Message

Merge 164739 - [GTK] Reduplicate common.top_level_path in scripts
https://bugs.webkit.org/show_bug.cgi?id=129291

Reviewed by Philippe Normand.

Duplicate common.top_level_path and avoid polluting many scripts with awkward system
path manipulation and weird dependencies on the jhbuild infrastructure.

* Scripts/run-gtk-tests: Use common again.
(TestRunner._setup_testing_environment): Ditto.
* gtk/check-gdom-symbols: Ditto.
* gtk/common.py:
(top_level_path): Re-add top_level_path..
(get_build_path): Use the builtin top_level_path again.
* gtk/find-make-dist-errors: Use common again.
(get_missing_headers): Ditto.
* gtk/generate-inspector-gresource-manifest.py: Ditto.


Conflicts:
	Tools/ChangeLog

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.4/Tools/Scripts/run-gtk-tests (168710 => 168711)


--- releases/WebKitGTK/webkit-2.4/Tools/Scripts/run-gtk-tests	2014-05-13 19:29:19 UTC (rev 168710)
+++ releases/WebKitGTK/webkit-2.4/Tools/Scripts/run-gtk-tests	2014-05-13 19:29:34 UTC (rev 168711)
@@ -31,9 +31,6 @@
 import common
 import jhbuildutils
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
-import jhbuildrc_common 
-
 class SkippedTest:
     ENTIRE_SUITE = None
 
@@ -198,7 +195,7 @@
     def _setup_testing_environment(self):
         self._test_env = os.environ
         self._test_env['GSETTINGS_BACKEND'] = 'memory'
-        self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = jhbuildrc_common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
+        self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit2")
         self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.tests_library_build_path()
         self._test_env["WEBKIT_EXEC_PATH"] = self._programs_path
 

Modified: releases/WebKitGTK/webkit-2.4/Tools/gtk/check-gdom-symbols (168710 => 168711)


--- releases/WebKitGTK/webkit-2.4/Tools/gtk/check-gdom-symbols	2014-05-13 19:29:19 UTC (rev 168710)
+++ releases/WebKitGTK/webkit-2.4/Tools/gtk/check-gdom-symbols	2014-05-13 19:29:34 UTC (rev 168711)
@@ -22,9 +22,6 @@
 import sys
 import tempfile
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
-import jhbuildrc_common 
-
 def should_update_symbols_file(new, old):
     if not os.path.exists(old):
         return False
@@ -52,7 +49,7 @@
                 tmp.write(file_handle.read())
         tmp.flush()
 
-        gdom_source_path = jhbuildrc_common.top_level_path('Source', 'WebCore', 'bindings')
+        gdom_source_path = common.top_level_path('Source', 'WebCore', 'bindings')
         api_break_test_path = os.path.join(gdom_source_path, 'scripts', 'gobject-run-api-break-test')
         subprocess.call([sys.executable, api_break_test_path, os.path.join(gdom_source_path, 'gobject',  'webkitdom.symbols'), tmp.name])
 

Modified: releases/WebKitGTK/webkit-2.4/Tools/gtk/common.py (168710 => 168711)


--- releases/WebKitGTK/webkit-2.4/Tools/gtk/common.py	2014-05-13 19:29:19 UTC (rev 168710)
+++ releases/WebKitGTK/webkit-2.4/Tools/gtk/common.py	2014-05-13 19:29:34 UTC (rev 168711)
@@ -21,9 +21,7 @@
 import subprocess
 import sys
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
-import jhbuildrc_common
-
+top_level_dir = None
 build_dir = None
 library_build_dir = None
 tests_library_build_dir = None
@@ -31,6 +29,13 @@
 build_types = ('Release', 'Debug')
 
 
+def top_level_path(*args):
+    global top_level_dir
+    if not top_level_dir:
+        top_level_dir = os.path.join(os.path.dirname(__file__), '..', '..')
+    return os.path.join(*(top_level_dir,) + args)
+
+
 def set_build_types(new_build_types):
     global build_types
     build_types = new_build_types
@@ -100,20 +105,20 @@
 
     global build_types
     for build_type in build_types:
-        build_dir = jhbuildrc_common.top_level_path('WebKitBuild', build_type)
+        build_dir = top_level_path('WebKitBuild', build_type)
         if is_valid_build_directory(build_dir):
             return build_dir
 
     # distcheck builds in a directory named _build in the top-level path.
-    build_dir = jhbuildrc_common.top_level_path("_build")
+    build_dir = top_level_path("_build")
     if is_valid_build_directory(build_dir):
         return build_dir
 
-    build_dir = jhbuildrc_common.top_level_path()
+    build_dir = top_level_path()
     if is_valid_build_directory(build_dir):
         return build_dir
 
-    build_dir = jhbuildrc_common.top_level_path("WebKitBuild")
+    build_dir = top_level_path("WebKitBuild")
     if is_valid_build_directory(build_dir):
         return build_dir
 

Modified: releases/WebKitGTK/webkit-2.4/Tools/gtk/find-make-dist-errors (168710 => 168711)


--- releases/WebKitGTK/webkit-2.4/Tools/gtk/find-make-dist-errors	2014-05-13 19:29:19 UTC (rev 168710)
+++ releases/WebKitGTK/webkit-2.4/Tools/gtk/find-make-dist-errors	2014-05-13 19:29:34 UTC (rev 168711)
@@ -20,9 +20,6 @@
 import subprocess
 import sys
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
-import jhbuildrc_common 
-
 def is_source_file_listing(line):
     return line.strip().startswith('Source')
 
@@ -89,7 +86,7 @@
 def get_missing_headers(listed_makefile_headers):
     missing = set()
     for header in listed_makefile_headers:
-        if not os.path.exists(jhbuildrc_common.top_level_path(header)):
+        if not os.path.exists(common.top_level_path(header)):
             missing.add(header)
     return missing
 

Modified: releases/WebKitGTK/webkit-2.4/Tools/gtk/generate-inspector-gresource-manifest.py (168710 => 168711)


--- releases/WebKitGTK/webkit-2.4/Tools/gtk/generate-inspector-gresource-manifest.py	2014-05-13 19:29:19 UTC (rev 168710)
+++ releases/WebKitGTK/webkit-2.4/Tools/gtk/generate-inspector-gresource-manifest.py	2014-05-13 19:29:34 UTC (rev 168711)
@@ -20,10 +20,7 @@
 import os
 import sys
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../jhbuild"))
-import jhbuildrc_common
-
-resources_path = jhbuildrc_common.top_level_path() + "/Source/WebInspectorUI/"
+resources_path = common.top_level_path() + "/Source/WebInspectorUI/"
 inspector_files = \
     glob.glob(resources_path + 'UserInterface/*.html') + \
     glob.glob(resources_path + 'UserInterface/*.js') + \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to