Title: [248489] trunk/Source/WebKitLegacy
Revision
248489
Author
krol...@apple.com
Date
2019-08-09 16:52:14 -0700 (Fri, 09 Aug 2019)

Log Message

Fix WebKitLegacy's post-process-header-rule script to support paths with spaces in them
https://bugs.webkit.org/show_bug.cgi?id=200595
<rdar://problem/54045608>

Reviewed by Darin Adler.

A number of scripts were added to WebKit, _javascript_Core, and
WebKitLegacy to support XCBuild's new facility for copying and
modifying files in one atomic step. The first two are OK, but
WebKitLegacy's script (post-process-header-rule) references a file via
a variable named "header", and does so without quoting the variable's
value. When the header's path contains spaces -- as can happen when
building Safari Technology Preview -- the script breaks. Fix this by
adding quoting.

* scripts/postprocess-header-rule:

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/ChangeLog (248488 => 248489)


--- trunk/Source/WebKitLegacy/ChangeLog	2019-08-09 23:30:29 UTC (rev 248488)
+++ trunk/Source/WebKitLegacy/ChangeLog	2019-08-09 23:52:14 UTC (rev 248489)
@@ -1,3 +1,22 @@
+2019-08-09  Keith Rollin  <krol...@apple.com>
+
+        Fix WebKitLegacy's post-process-header-rule script to support paths with spaces in them
+        https://bugs.webkit.org/show_bug.cgi?id=200595
+        <rdar://problem/54045608>
+
+        Reviewed by Darin Adler.
+
+        A number of scripts were added to WebKit, _javascript_Core, and
+        WebKitLegacy to support XCBuild's new facility for copying and
+        modifying files in one atomic step. The first two are OK, but
+        WebKitLegacy's script (post-process-header-rule) references a file via
+        a variable named "header", and does so without quoting the variable's
+        value. When the header's path contains spaces -- as can happen when
+        building Safari Technology Preview -- the script breaks. Fix this by
+        adding quoting.
+
+        * scripts/postprocess-header-rule:
+
 2019-08-08  Brent Fulgham  <bfulg...@apple.com>
 
         [FTW] Get WebKit, WebKit2, and MiniBrowser building and executing

Modified: trunk/Source/WebKitLegacy/scripts/postprocess-header-rule (248488 => 248489)


--- trunk/Source/WebKitLegacy/scripts/postprocess-header-rule	2019-08-09 23:30:29 UTC (rev 248488)
+++ trunk/Source/WebKitLegacy/scripts/postprocess-header-rule	2019-08-09 23:52:14 UTC (rev 248489)
@@ -59,22 +59,22 @@
     fi
 done
 
-unifdef -B ${unifdefOptions} -o ${header}.unifdef ${header}
+unifdef -B ${unifdefOptions} -o "${header}.unifdef" "${header}"
 case $? in
-    0) rm ${header}.unifdef ;;
-    1) mv ${header}{.unifdef,} ;;
+    0) rm "${header}".unifdef ;;
+    1) mv "${header}"{.unifdef,} ;;
     *) exit 1 ;;
 esac
 
-if [[ ${header} == "./WebKitAvailability.h" ]]; then
+if [[ "${header}" == "./WebKitAvailability.h" ]]; then
     exit 0
 fi
 
 if [[ ${WK_PLATFORM_NAME} != macosx ]]; then
-    sed -E -e "s/ *WEBKIT_((CLASS_|ENUM_)?(AVAILABLE|DEPRECATED))_MAC\([^)]+\)//g" < ${header} > ${header}.sed
-    if cmp -s ${header} ${header}.sed; then
-        rm ${header}.sed
+    sed -E -e "s/ *WEBKIT_((CLASS_|ENUM_)?(AVAILABLE|DEPRECATED))_MAC\([^)]+\)//g" < "${header}" > "${header}.sed"
+    if cmp -s "${header}" "${header}.sed"; then
+        rm "${header}.sed"
     else
-        mv ${header}.sed ${header}
+        mv "${header}.sed" "${header}"
     fi
 fi
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to