summaryrefslogtreecommitdiffstats
ModeNameSize
-rw-r--r--.cvsignore47logstatsplain
-rw-r--r--Makefile3786logstatsplain
d---------docs1052logstatsplain
-rw-r--r--isolinux-graphic.bmp480566logstatsplain
d---------kernel236logstatsplain
-rw-r--r--live_update2414logstatsplain
-rwxr-xr-xmake_boot_img21389logstatsplain
d---------mdk-stage12436logstatsplain
d---------perl-install3224logstatsplain
d---------rescue792logstatsplain
d---------tools1199logstatsplain
cense # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Tool to avoid common grammar errors in po files. use MDK::Common; my $col = $ENV{GREP_COLOR} || "01"; sub colorize { "[1;$col;40m@_" } sub get_file($) { local *FIL; open FIL, "$_[0]" or die "Can't open $_[0]"; my @file_content = <FIL>; close FIL; my @out; my $msgstr = 0; my $line_number = 0; foreach (@file_content) { $line_number++; /msgid/ and $msgstr = 0; /msgstr/ and $msgstr = 1; $msgstr and push @out, sprintf("%4d ", $line_number).$_; } @out; } sub check { my ($category, $condition, $msg, @exceptions) = @_; my $line = $_; my $rest = ''; #- kinda hard to make multiple match and still can highlight the right one.. my $adv = sub { $rest .= substr $line, 0, 1; $line =~ s/^.// }; while (length($line) > 1) { $line =~ /$condition/ or return; my ($rest_, $before, $match, $after) = ($rest, $`, $&, $'); $adv->() foreach 1 .. length($before); $_->($before, $match, $after) and goto next_char foreach @exceptions; printf "$category: %-30s ", $msg; print $rest_, $before, colorize($match), $after; next_char: $adv->() foreach 1 .. length($match); } } my @names = qw(XFree MHz GHz KBabel XFdrake IPv4 MTools iBook DrakX MacOS MacOSX G3 G4 DVD Drakbackup Inc Gnome Mandrake IceWM MySQL PostgreSQL Enlightenment Window WindowMaker Fvwm SunOS ReiserFS iMac CD OF LPRng ext2FS PowerBook OSs CUPS NIS KDE GNOME BootX TVout WebDAV IP SMB Boston MA MtoolsFM PCI USB ISA PnP XawTV PSC LaserJet Sony LPT\d Frank Thomas Sergey XSane M ClusterNFS 3Com drakTermServ RAMdisk LOCAL); sub match { my ($e) = @_; sub { my ($before, $match, $after) = @_; $match =~ /^$e/ } } sub match_after { my ($e) = @_; sub { my ($before, $match, $after) = @_; "$match$after" =~ /^$e/ } } sub match_full { my ($e) = @_; sub { my ($before, $match, $after) = @_; "$match$after" =~ /^$e/ } } sub mixed_case($) { check('**', '\b\w[A-Z]\w*[a-z]\b', 'mixed-case', sub { my ($b, $m, $a) = @_; $b =~ /\\$/ && $m =~ /^t/ }, sub { my ($b, $m, $a) = @_; $b =~ /\\$/ && $m =~ /^fI/ }, match('_[A-Z][a-z]+\b'), map { match_after($_.'\b') } @names); check('**', '\b\w[a-z]\w*[A-Z]\b', 'mixed-case', map { match_after($_.'\b') } @names); } sub uppercase_after_comma($) { check('**', ', [A-Z]', 'uppercase-after-comma', map { match_after(", $_".'\b') } @names); } sub lowercase_after_dot($) { check('**', '\. [a-z]', 'lowercase-after-dot', sub { my ($b, $m, $a) = @_; any { $b =~ /$_$/ } qw(id ex) }, sub { my ($b, $m, $a) = @_; any { $b =~ /\Q$_\E$/ } qw (S.A N.B) },