/usr/bin/tv_validate_file is in xmltv-util 0.5.69-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 107 108 109 110 111 112 113 114 115 | #!/usr/bin/perl -w
use strict;
use XMLTV::Version '$Id: tv_validate_file.in,v 1.4 2015/07/12 00:46:37 knowledgejunkie Exp $';
use XMLTV::ValidateFile qw/LoadDtd ValidateFile/;
use Getopt::Long;
=pod
=head1 NAME
tv_validate_file - Validate that a file contains valid xmltv data.
=head1 SYNOPSIS
tv_validate_file --help
tv_validate_grabber [--dtd-file <dtdfile>] <file>
=head1 DESCRIPTION
=head1 OPTIONS
B<--dtd <dtdfile>> Use the specified file as the xmltv dtd instead of
downloading it from the web.
=head1 AUTHOR
Mattias Holmlund, mattias -at- holmlund -dot- se.
=cut
my $opt = { "dtd-file" => undef,
help => 0,
};
my $res = GetOptions( $opt, qw/
dtd-file=s
help|h
/ );
if ((not $res) or $opt->{help} or scalar( @ARGV ) != 1) {
print << "EOHELP";
Usage: $0 [options] <file>
EOHELP
exit 1;
}
my( $file ) = @ARGV;
if( defined( $opt->{'dtd-file'}) ) {
if (not LoadDtd( $opt->{'dtd-file'} )) {
print STDERR "Failed to load dtd from $opt->{'dtd-file'}.\n" .
"Use the --dtd-file option to specify another path to the dtd.\n";
exit 1;
}
}
my @errors = ValidateFile( $file );
if (scalar @errors) {
if (grep(/^not(well|valid)$/, @errors)) {
print "The file did not validate as well-formed XML, so no further\nprocessing was performed.\n";
exit 1;
}
my $errors = scalar @errors;
print "$errors error" . ($errors > 1 ? "s" : "") . " found.\n";
exit 1;
}
else {
print "Validated ok.\n";
exit 0;
}
=head1 COPYRIGHT
Copyright (C) 2005, 2007 Mattias Holmlund.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
=cut
### Setup indentation in Emacs
## Local Variables:
## perl-indent-level: 4
## perl-continued-statement-offset: 4
## perl-continued-brace-offset: 0
## perl-brace-offset: -4
## perl-brace-imaginary-offset: 0
## perl-label-offset: -2
## cperl-indent-level: 4
## cperl-brace-offset: 0
## cperl-continued-brace-offset: 0
## cperl-label-offset: -2
## cperl-extra-newline-before-brace: t
## cperl-merge-trailing-else: nil
## cperl-continued-statement-offset: 2
## indent-tabs-mode: t
## End:
|