diff options
author | Ben Murdoch <benm@google.com> | 2010-06-15 19:36:43 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-06-16 14:52:28 +0100 |
commit | 545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch) | |
tree | c0c14763654d84d37577dde512c3d3b4699a9e86 /WebKitTools/Scripts/do-webcore-rename | |
parent | 719298a66237d38ea5c05f1547123ad8aacbc237 (diff) | |
download | external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2 |
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'WebKitTools/Scripts/do-webcore-rename')
-rwxr-xr-x | WebKitTools/Scripts/do-webcore-rename | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename index 32dd05e..e2ce019 100755 --- a/WebKitTools/Scripts/do-webcore-rename +++ b/WebKitTools/Scripts/do-webcore-rename @@ -29,16 +29,42 @@ # Script to do a rename in JavaScriptCore, WebCore, and WebKit. use strict; + +use File::Find; use FindBin; +use Getopt::Long qw(:config pass_through); + use lib $FindBin::Bin; use webkitdirs; -use File::Find; use VCSUtils; setConfiguration(); chdirWebKit(); -my %words; +my $showHelp; +my $verbose; + +my $programName = basename($0); +my $usage = <<EOF; +Usage: $programName [options] + -h|--help Show this help message + -v|--verbose More verbose output +EOF + +my $getOptionsResult = GetOptions( + 'help|h' => \$showHelp, + 'verbose|v' => \$verbose, +); + +if (!$getOptionsResult || $showHelp) { + print STDERR $usage; + exit 1; +} + +my @directoriesToIgnoreList = ( + "icu", +); +my %directoriesToIgnore = map { $_ => 1 } @directoriesToIgnoreList; # find all files we want to process @@ -52,17 +78,13 @@ sub wanted { my $file = $_; - if ($file eq "icu") { - $File::Find::prune = 1; - return; - } - - if ($file =~ /^\../) { + # Ignore excluded and hidden files/directories. + if ($directoriesToIgnore{$file} or $file =~ /^\../ or $file =~ /^ChangeLog/) { + print "Ignoring $File::Find::name\n" if $verbose; $File::Find::prune = 1; return; } - return if $file =~ /^ChangeLog/; return if -d $file; push @paths, $File::Find::name; @@ -70,28 +92,10 @@ sub wanted # Setting isDOMTypeRename to 1 rather than 0 expands the regexps used # below to handle custom JavaScript bindings. -my $isDOMTypeRename = 1; +my $isDOMTypeRename = 0; my %renames = ( - "WebGLArray" => "ArrayBufferView", - "WebGLArrayBuffer" => "ArrayBuffer", - "WebGLByteArray" => "Int8Array", - "WebGLFloatArray" => "FloatArray", - "WebGLIntArray" => "Int32Array", - "WebGLIntegralTypedArrayBase" => "IntegralTypedArrayBase", - "WebGLShortArray" => "Int16Array", - "WebGLUnsignedByteArray" => "Uint8Array", - "WebGLUnsignedIntArray" => "Uint32Array", - "WebGLUnsignedShortArray" => "Uint16Array", - "WebGLTypedArrayBase" => "TypedArrayBase", - # JSDOMWindow constructors. - "webGLArrayBuffer" => "arrayBuffer", - "webGLByteArray" => "int8Array", - "webGLFloatArray" => "floatArray", - "webGLIntArray" => "int32Array", - "webGLShortArray" => "int16Array", - "webGLUnsignedByteArray" => "uint8Array", - "webGLUnsignedIntArray" => "uint32Array", - "webGLUnsignedShortArray" => "uint16Array", + # Renames go here in the form of: + # "Tokenizer" => "DocumentParser", ); my %renamesContemplatedForTheFuture = ( @@ -224,7 +228,7 @@ for my $file (sort @paths) { my $contents; { local $/; - open FILE, $file or die; + open FILE, $file or die "Failed to open $file"; $contents = <FILE>; close FILE; } @@ -242,7 +246,7 @@ for my $file (sort @paths) { } if ($newContents ne $contents) { - open FILE, ">", $file or die; + open FILE, ">", $file or die "Failed to open $file"; print FILE $newContents; close FILE; } |