Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: third_party/devscripts/licensecheck.pl

Issue 7974012: Speed up check_licenses by another 30% by scanning less files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/devscripts/chromium-1.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 # This script was originally based on the script of the same name from 2 # This script was originally based on the script of the same name from
3 # the KDE SDK (by dfaure@kde.org) 3 # the KDE SDK (by dfaure@kde.org)
4 # 4 #
5 # This version is 5 # This version is
6 # Copyright (C) 2007, 2008 Adam D. Barratt 6 # Copyright (C) 2007, 2008 Adam D. Barratt
7 # 7 #
8 # This program is free software; you can redistribute it and/or modify 8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by 9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or 10 # the Free Software Foundation; either version 2 of the License, or
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if ($opt_version) { version(); exit 0; } 234 if ($opt_version) { version(); exit 0; }
235 235
236 die "Usage: $progname [options] filelist\nRun $progname --help for more details\ n" unless @ARGV; 236 die "Usage: $progname [options] filelist\nRun $progname --help for more details\ n" unless @ARGV;
237 237
238 $opt_lines = $def_lines if not defined $opt_lines; 238 $opt_lines = $def_lines if not defined $opt_lines;
239 239
240 my @files = (); 240 my @files = ();
241 my @find_args = (); 241 my @find_args = ();
242 my $files_count = @ARGV; 242 my $files_count = @ARGV;
243 243
244 push @find_args, qw(-not ( -path */LayoutTests/* -prune ) );
245 push @find_args, qw(-not ( -path */out/Debug/* -prune ) );
Evan Martin 2011/09/22 20:54:12 */out/* is probably better. (In theory gyp can ge
246 push @find_args, qw(-not ( -path */out/Release/* -prune ) );
247 push @find_args, qw(-not ( -path *.git* -prune ) );
248 push @find_args, qw(-not ( -path *.svn* -prune ) );
249
244 push @find_args, qw(-maxdepth 1) unless $opt_recursive; 250 push @find_args, qw(-maxdepth 1) unless $opt_recursive;
245 push @find_args, qw(-follow -type f -print); 251 push @find_args, qw(-follow -type f -print);
246 252
247 while (@ARGV) { 253 while (@ARGV) {
248 my $file = shift @ARGV; 254 my $file = shift @ARGV;
249 255
250 if (-d $file) { 256 if (-d $file) {
251 open FIND, '-|', 'find', $file, @find_args 257 open FIND, '-|', 'find', $file, @find_args
252 or die "$progname: couldn't exec find: $!\n"; 258 or die "$progname: couldn't exec find: $!\n";
253 259
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 return $license; 521 return $license;
516 } 522 }
517 523
518 sub fatal($) { 524 sub fatal($) {
519 my ($pack,$file,$line); 525 my ($pack,$file,$line);
520 ($pack,$file,$line) = caller(); 526 ($pack,$file,$line) = caller();
521 (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d; 527 (my $msg = "$progname: fatal error at line $line:\n@_\n") =~ tr/\0//d;
522 $msg =~ s/\n\n$/\n/; 528 $msg =~ s/\n\n$/\n/;
523 die $msg; 529 die $msg;
524 } 530 }
OLDNEW
« no previous file with comments | « third_party/devscripts/chromium-1.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698