From: Greg Sabino Mullane Date: Wed, 30 Apr 2008 14:52:12 +0000 (+0000) Subject: Minor cleanups. X-Git-Tag: 1.31.0-rc.0~47987 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=aaac504e00d82b958cb6e3ebe5110f159d0a59dc;p=lhc%2Fweb%2Fwiklou.git Minor cleanups. --- diff --git a/maintenance/postgres/compare_schemas.pl b/maintenance/postgres/compare_schemas.pl index fd06502425..7c1b287eaa 100644 --- a/maintenance/postgres/compare_schemas.pl +++ b/maintenance/postgres/compare_schemas.pl @@ -67,7 +67,7 @@ my ($table,%old); my %xinfo; for my $xfile (@xfile) { print "Loading $xfile\n"; - my $info = &parse_sql($xfile); + my $info = parse_sql($xfile); for (keys %$info) { $xinfo{$_} = $info->{$_}; } @@ -75,7 +75,7 @@ for my $xfile (@xfile) { for my $oldfile (@old) { print "Loading $oldfile\n"; - my $info = &parse_sql($oldfile); + my $info = parse_sql($oldfile); for (keys %xinfo) { $info->{$_} = $xinfo{$_}; } @@ -100,7 +100,7 @@ sub parse_sql { $table = $1; $info{$table}{name}=$table; } - elsif (m#^\) /\*\$wgDBTableOptions\*/#) { + elsif (m{^\) /\*\$wgDBTableOptions\*/}) { $info{$table}{engine} = 'TYPE'; $info{$table}{type} = 'variable'; } @@ -127,7 +127,7 @@ sub parse_sql { } } - close $oldfh; + close $oldfh or die qq{Could not close "$oldfile": $!\n}; return \%info; @@ -145,10 +145,10 @@ while (<$pfh>) { } next; } - $ptable{$1}=2 while /'(\w+)'/g; + $ptable{$1}=2 while m{'(\w+)'}g; last if /\);/; } -close $pfh; +close $pfh or die qq{Could not close "$parsefile": $!\n}; my $OK_NOT_IN_PTABLE = ' filearchive @@ -461,7 +461,7 @@ sub check_includes_dir { ## Check for some common errors in the files in the includes directory print "Checking files in includes directory...\n"; - my $dir = "../../includes"; + my $dir = '../../includes'; opendir my $dh, $dir or die qq{Could not opendir $dir: $!\n}; for my $file (grep { -f "$dir/$_" and /\.php$/ } readdir $dh) { $file = "$dir/$file"; @@ -484,8 +484,7 @@ sub check_includes_dir { } closedir $dh or die qq{Closedir failed?!\n}; - - + return; } ## end of check_includes_dir