Speed up check_licenses by another 30% by scanning less files.

This improves run time from ~3 minutes to ~2 minutes for me locally.

BUG=28291

Review URL: http://codereview.chromium.org/7974012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102363 0039d316-1c4b-4281-b951-d872f2087c98
parent b929498e
--- licensecheck.pl.orig 2011-09-22 10:51:25.934402455 -0700 --- licensecheck.pl.orig 2011-09-22 10:51:25.934402455 -0700
+++ licensecheck.pl 2011-09-22 10:45:54.585545044 -0700 +++ licensecheck.pl 2011-09-22 10:45:54.585545044 -0700
@@ -241,6 +241,12 @@ my @files = ();
my @find_args = ();
my $files_count = @ARGV;
+push @find_args, qw(-not ( -path */LayoutTests/* -prune ) );
+push @find_args, qw(-not ( -path */out/Debug/* -prune ) );
+push @find_args, qw(-not ( -path */out/Release/* -prune ) );
+push @find_args, qw(-not ( -path *.git* -prune ) );
+push @find_args, qw(-not ( -path *.svn* -prune ) );
+
push @find_args, qw(-maxdepth 1) unless $opt_recursive;
push @find_args, qw(-follow -type f -print);
@@ -277,10 +277,6 @@ @@ -277,10 +277,6 @@
while (<F>) { while (<F>) {
last if ($. > $opt_lines); last if ($. > $opt_lines);
......
...@@ -241,6 +241,12 @@ my @files = (); ...@@ -241,6 +241,12 @@ my @files = ();
my @find_args = (); my @find_args = ();
my $files_count = @ARGV; my $files_count = @ARGV;
push @find_args, qw(-not ( -path */LayoutTests/* -prune ) );
push @find_args, qw(-not ( -path */out/Debug/* -prune ) );
push @find_args, qw(-not ( -path */out/Release/* -prune ) );
push @find_args, qw(-not ( -path *.git* -prune ) );
push @find_args, qw(-not ( -path *.svn* -prune ) );
push @find_args, qw(-maxdepth 1) unless $opt_recursive; push @find_args, qw(-maxdepth 1) unless $opt_recursive;
push @find_args, qw(-follow -type f -print); push @find_args, qw(-follow -type f -print);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment