[Pkg-mediawiki-commits] r181 - mediawiki-extensions/trunk
Thorsten Glaser
tg at alioth.debian.org
Tue Jun 29 08:06:11 UTC 2010
Author: tg
Date: 2010-06-29 08:06:08 +0000 (Tue, 29 Jun 2010)
New Revision: 181
Modified:
mediawiki-extensions/trunk/check_versions.pl
Log:
speed up greatly by skipping all these grep(1) invocations
this also fixes a bug whereas missing files whose names were
part of other names of files that were, indeed, included would
not have been offered for inclusion/rejection
Modified: mediawiki-extensions/trunk/check_versions.pl
===================================================================
--- mediawiki-extensions/trunk/check_versions.pl 2010-06-29 08:02:12 UTC (rev 180)
+++ mediawiki-extensions/trunk/check_versions.pl 2010-06-29 08:06:08 UTC (rev 181)
@@ -22,8 +22,16 @@
my @exttops;
my $file = shift;
my $redirect = ">/dev/null 2>&1" unless defined $options{v} ;
+my %allfiles;
open (F, $file);
+while (<F>) {
+ next if (/^\s*(#.*)*$/);
+ /^(.+)\s-\s(.+)\s-\s(.+)\s-\s(.+)\s-\s(.+)\s-\s(-?\d+)/;
+ $allfiles{$1} = 1;
+}
+close(F);
+open (F, $file);
sub latest_revision {
my $url = shift ;
@@ -47,7 +55,7 @@
for (@added) { $is_added{$_} = 1; }
print "Checking other files in the same directory...\n" ;
foreach $new_file (@lines) {
- my $exists = `LC_ALL=C grep "^$base/$new_file" <"$file"` ;
+ my $exists = $allfiles{"$base/$new_file"};
my @filtered = grep(/$new_file/, at blacklist);
print "Checking: $new_file\n";
my $size = @filtered;
More information about the Pkg-mediawiki-commits
mailing list