blob: 28b34205378b2f1bf2fd600b3943ed3ae270c351 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 22d5063c551d3c08c0a4ad8b80e08b793d53093d Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 10 Sep 2015 16:23:27 +0300
4Subject: [PATCH] This patch fixes a command line that is too long (over 100K!)
5 and is rejected by /bin/sh.
6
7Upstream-Status: Backport [should appear in 2.10, http://trac.webkit.org/changeset/184856]
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9
10---
11 Source/WebKit2/PlatformGTK.cmake | 11 ++++++-----
12 Tools/gtk/generate-inspector-gresource-manifest.py | 16 ++++++++++++----
13 2 files changed, 18 insertions(+), 9 deletions(-)
14
15diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake
16index a13af7c..058c241 100644
17--- a/Source/WebKit2/PlatformGTK.cmake
18+++ b/Source/WebKit2/PlatformGTK.cmake
19@@ -408,7 +408,7 @@ set(WebKit2WebExtension_INSTALLED_HEADERS
20 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
21 )
22
23-file(GLOB InspectorFiles
24+set(InspectorFiles
25 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
26 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
27 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
28@@ -423,13 +423,14 @@ file(GLOB InspectorFiles
29 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
30 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
31 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
32-)
33-
34-list(APPEND InspectorFiles
35 ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
36 ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
37 )
38
39+file(GLOB InspectorFilesDependencies
40+ ${InspectorFiles}
41+)
42+
43 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
44 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
45 "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
46@@ -564,7 +565,7 @@ add_custom_command(
47
48 add_custom_command(
49 OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
50- DEPENDS ${InspectorFiles}
51+ DEPENDS ${InspectorFilesDependencies}
52 ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
53 COMMAND ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles}
54 VERBATIM
55diff --git a/Tools/gtk/generate-inspector-gresource-manifest.py b/Tools/gtk/generate-inspector-gresource-manifest.py
56index 0687c4c..03060cf 100755
57--- a/Tools/gtk/generate-inspector-gresource-manifest.py
58+++ b/Tools/gtk/generate-inspector-gresource-manifest.py
59@@ -16,6 +16,7 @@
60 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
61
62 import argparse
63+import glob
64 import os
65 import sys
66
67@@ -26,10 +27,17 @@ BASE_DIR = 'WebInspectorUI/'
68 def get_filenames(args):
69 filenames = []
70
71- for filename in args:
72- base_dir_index = filename.rfind(BASE_DIR)
73- if base_dir_index != -1:
74- filenames.append(filename[base_dir_index + len(BASE_DIR):])
75+ for pattern in args:
76+ paths = glob.glob(pattern)
77+ for filename in paths:
78+ base_dir_index = filename.rfind(BASE_DIR)
79+ if base_dir_index != -1:
80+ name = filename[base_dir_index + len(BASE_DIR):]
81+ # The result should use forward slashes, thus make sure any os-specific
82+ # separator, added by the glob.glob() call, is properly replaced
83+ if os.sep != '/':
84+ name = name.replace(os.sep, '/')
85+ filenames.append(name)
86 return filenames
87
88
89--
902.1.4
91