/usr/bin/check_perldiag is in libparse-errorstring-perl-perl 0.15-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | #!/usr/bin/perl -w
eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
if 0; # not running under some shell
package check_perldiag;
BEGIN {
$check_perldiag::VERSION = '0.15';
}
# ABSTRACT: check a localized version of L<peldiag> for consistency
use strict;
use warnings;
use Pod::Find ();
use Pod::POM ();
my $localized_perldiag = $ARGV[0];
die "No perldiag specified" unless $localized_perldiag;
my $localized_pod_filename = Pod::Find::pod_where({-inc => 1}, $localized_perldiag);
my $default_pod_filename = Pod::Find::pod_where({-inc => 1}, 'perldiag');
my $parser = Pod::POM->new();
my $pom_local = $parser->parse_file($localized_pod_filename);
if (!$pom_local) {
die "Could not parse localized perldiag: " . $parser->error();
}
my $pom_default = $parser->parse_file($default_pod_filename);
if (!$pom_default) {
die "Could not parse default perldiag: " . $parser->error();
}
my (@local_errors, @default_errors);
foreach my $item ($pom_local->head1->[1]->over->[0]->item) {
push @local_errors, $item->title;
}
foreach my $item ($pom_default->head1->[1]->over->[0]->item) {
push @default_errors, $item->title;
}
if ($#local_errors != $#default_errors) {
print "Unequal number of errors: localized - $#local_errors, default - $#default_errors.\n";
}
for (my $i = 0; $i <= $#local_errors; $i++) {
if ($local_errors[$i] ne $default_errors[$i]) {
print 'Got: "' . $local_errors[$i] . '", expected: "' . $default_errors[$i] . '".' . "\n";
}
}
=pod
=head1 NAME
check_perldiag - check a localized version of L<peldiag> for consistency
=head1 VERSION
version 0.15
=head1 SYNOPSIS
From the command line:
check_perldiag POD2::FR::perldiag
=head1 DESCRIPTION
This script compares a translated version of L<peldiag> with the default L<peldiag> installed with perl. It compares each error message in the two files and tells you if they do not match. A warning is issued if the two files contain a different number of error messages defined.
=head1 AUTHORS
=over 4
=item *
Petar Shangov, C<< <pshangov at yahoo.com> >>
=item *
Gabor Szabo L<http://szabgab.com/>
=item *
Ahmad M. Zawawi <ahmad.zawawi@gmail.com>
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Petar Shangov.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__END__
|