fix-blink-patch: tool to fix up renamed directory paths in Blink
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 18:55:10 +0000 (18:55 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Mar 2014 18:55:10 +0000 (18:55 +0000)
<http://webkit.org/b/130609>

Reviewed by Ryosuke Niwa.

Usage: cat blink.patch | fix-blink-patch | svn-apply

* Scripts/fix-blink-patch: Added.

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

Tools/ChangeLog
Tools/Scripts/fix-blink-patch [new file with mode: 0755]

index 0b3192933212c304c17fc3904d8e14eb69de594b..92df50f7c0989059757ba6c6d7ad997250b55c26 100644 (file)
@@ -1,3 +1,14 @@
+2014-03-21  David Kilzer  <ddkilzer@apple.com>
+
+        fix-blink-patch: tool to fix up renamed directory paths in Blink
+        <http://webkit.org/b/130609>
+
+        Reviewed by Ryosuke Niwa.
+
+        Usage: cat blink.patch | fix-blink-patch | svn-apply
+
+        * Scripts/fix-blink-patch: Added.
+
 2014-03-21  Darin Adler  <darin@apple.com>
 
         Remove use of deprecatedCharacters in WebKit API tests
 2014-03-21  Darin Adler  <darin@apple.com>
 
         Remove use of deprecatedCharacters in WebKit API tests
diff --git a/Tools/Scripts/fix-blink-patch b/Tools/Scripts/fix-blink-patch
new file mode 100755 (executable)
index 0000000..3733ad1
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2014 Apple 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:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  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.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
+
+# fix-blink-patch -- fixes paths of a Blink commit so they match up with WebKit
+
+use strict;
+use warnings;
+
+use File::Basename;
+use Getopt::Long;
+
+my $showHelp = 0;
+
+my $getOptionsResult = GetOptions(
+    'help'       => \$showHelp,
+);
+
+if (!$getOptionsResult || $showHelp) {
+    print STDERR "Usage: ", basename($0), " [options] < patch\n";
+    print STDERR "  -h|--help     Show help\n";
+    exit 1;
+}
+
+while (my $line = <>) {
+    $line =~ s#([ab]/| )Source/core/#$1Source/WebCore/#mg;
+    $line =~ s#([ab]/| )Source/bindings/#$1Source/WebCore/bindings/#mg;
+    print $line;
+}
+
+exit 0;