summaryrefslogtreecommitdiffstats
path: root/podwrapper.pl.in
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-08-28 13:15:29 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-08-28 13:18:47 +0100
commitddc67d94f37ca4e942cb385d4e5ec476766fef12 (patch)
tree31b78318cae79c36ef2caf126685f62b9cf1ea58 /podwrapper.pl.in
parent540fbfcf34089e2baeea9c94a850cdea0c0db903 (diff)
downloadlibguestfs-ddc67d94f37ca4e942cb385d4e5ec476766fef12.tar.gz
libguestfs-ddc67d94f37ca4e942cb385d4e5ec476766fef12.tar.xz
libguestfs-ddc67d94f37ca4e942cb385d4e5ec476766fef12.zip
po-docs: Fix podwrapper so it works on translated POD files.
These don't contain literal strings like "AUTHORS" (they have the translated versions instead) and so checking for these English strings is rather useless. Also we don't usually have the '--license' parameter conveniently around so don't enforce this section.
Diffstat (limited to 'podwrapper.pl.in')
-rwxr-xr-xpodwrapper.pl.in43
1 files changed, 28 insertions, 15 deletions
diff --git a/podwrapper.pl.in b/podwrapper.pl.in
index 15e2eadb..b8b04593 100755
--- a/podwrapper.pl.in
+++ b/podwrapper.pl.in
@@ -131,6 +131,16 @@ not set, defaults to C<1>.
=cut
+my $strict_checks = 1;
+
+=item B<--no-strict-checks>
+
+Disable strict checks of the man page. This is only used
+when generating the translated man pages in the C<po-docs>
+subdirectory.
+
+=cut
+
my $text;
=item B<--text=output.txt>
@@ -173,6 +183,7 @@ GetOptions ("help|?" => \$help,
"man=s" => \$man,
"name=s" => \$name,
"section=s" => \$section,
+ "strict-checks!" => \$strict_checks,
"text=s" => \$text,
"verbatim=s" => \@verbatims
) or pod2usage (2);
@@ -182,7 +193,7 @@ die "$progname: missing argument: podwrapper input.pod\n" unless @ARGV == 1;
my $input = $ARGV[0];
die "$progname: $input: missing argument: --license parameter is required\n"
- unless @licenses >= 1;
+ if $strict_checks && @licenses == 0;
# There should be at least one output.
die "$progname: $input: no output format specified. Use --man and/or --html and/or --text.\n"
@@ -249,20 +260,22 @@ foreach (@verbatims) {
$content =~ s/$a[1]/$replacement/ge;
}
-# Verify sections present / not present.
-die "$progname: $input: missing AUTHOR or AUTHORS section\n"
- unless $content =~ /^=head1 AUTHOR/m;
-die "$progname: $input: missing SEE ALSO section\n"
- unless $content =~ /^=head1 SEE ALSO/m;
-die "$progname: $input: missing COPYRIGHT section\n"
- unless $content =~ /^=head1 COPYRIGHT/m;
-die "$progname: $input: BUGS is now added automatically, do not add it to the POD file\n"
- if $content =~ /^=head1 (REPORTING )?BUGS/m;
-die "$progname: $input: LICENSE is now added automatically, do not add it to the POD file\n"
- if $content =~ /^=head1 LICENSE/m;
-die "$progname: $input: GPL/LGPL should be specified using the --license parameter, not included in the POD file\n"
- if $content =~ /^This program is free software/ ||
- $content =~ /^This library is free software/;
+if ($strict_checks) {
+ # Verify sections present / not present.
+ die "$progname: $input: missing AUTHOR or AUTHORS section\n"
+ unless $content =~ /^=head1 AUTHOR/m;
+ die "$progname: $input: missing SEE ALSO section\n"
+ unless $content =~ /^=head1 SEE ALSO/m;
+ die "$progname: $input: missing COPYRIGHT section\n"
+ unless $content =~ /^=head1 COPYRIGHT/m;
+ die "$progname: $input: BUGS is now added automatically, do not add it to the POD file\n"
+ if $content =~ /^=head1 (REPORTING )?BUGS/m;
+ die "$progname: $input: LICENSE is now added automatically, do not add it to the POD file\n"
+ if $content =~ /^=head1 LICENSE/m;
+ die "$progname: $input: GPL/LGPL should be specified using the --license parameter, not included in the POD file\n"
+ if $content =~ /^This program is free software/ ||
+ $content =~ /^This library is free software/;
+}
# Add standard LICENSE and BUGS sections.
my $LGPLv2plus =