diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-08-28 13:15:29 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-08-28 13:18:47 +0100 |
commit | ddc67d94f37ca4e942cb385d4e5ec476766fef12 (patch) | |
tree | 31b78318cae79c36ef2caf126685f62b9cf1ea58 | |
parent | 540fbfcf34089e2baeea9c94a850cdea0c0db903 (diff) | |
download | libguestfs-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.
-rw-r--r-- | po-docs/ja/Makefile.am | 25 | ||||
-rw-r--r-- | po-docs/uk/Makefile.am | 25 | ||||
-rwxr-xr-x | podwrapper.pl.in | 43 |
3 files changed, 72 insertions, 21 deletions
diff --git a/po-docs/ja/Makefile.am b/po-docs/ja/Makefile.am index 52184023..c4c8b487 100644 --- a/po-docs/ja/Makefile.am +++ b/po-docs/ja/Makefile.am @@ -58,8 +58,10 @@ all-local: $(MANPAGES) guestfs.3: guestfs.pod guestfs-actions.pod guestfs-availability.pod guestfs-structs.pod $(PODWRAPPER) \ - --section 3 \ + --no-strict-checks \ --man $@ \ + --section 3 \ + --license LGPLv2+ \ --insert $(srcdir)/guestfs-actions.pod:@ACTIONS@ \ --insert $(srcdir)/guestfs-availability.pod:@AVAILABILITY@ \ --insert $(srcdir)/guestfs-structs.pod:@STRUCTS@ \ @@ -67,23 +69,40 @@ guestfs.3: guestfs.pod guestfs-actions.pod guestfs-availability.pod guestfs-stru guestfish.1: guestfish.pod guestfish-actions.pod guestfish-commands.pod $(PODWRAPPER) \ + --no-strict-checks \ --man $@ \ + --license GPLv2+ \ --insert $(srcdir)/guestfish-actions.pod:@ACTIONS@ \ --insert $(srcdir)/guestfish-commands.pod:@FISH_COMMANDS@ \ $< virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.pod $(PODWRAPPER) \ + --no-strict-checks \ --man $@ \ + --license GPLv2+ \ --insert sysprep-extra-options.pod:@EXTRA_OPTIONS@ \ --insert sysprep-operations.pod:@OPERATIONS@ \ $< %.1: %.pod - $(PODWRAPPER) --man $@ $< + $(PODWRAPPER) \ + --no-strict-checks \ + --man $@ \ + $< + +%.3: %.pod + $(PODWRAPPER) \ + --no-strict-checks \ + --man $@ \ + --section 3 \ + $< %.1: %.pl - $(PODWRAPPER) --man $@ $< + $(PODWRAPPER) \ + --no-strict-checks \ + --man $@ \ + $< # Ensure that the first time we build from git, since guestfs.pod # hasn't been built yet, build it. diff --git a/po-docs/uk/Makefile.am b/po-docs/uk/Makefile.am index 52184023..c4c8b487 100644 --- a/po-docs/uk/Makefile.am +++ b/po-docs/uk/Makefile.am @@ -58,8 +58,10 @@ all-local: $(MANPAGES) guestfs.3: guestfs.pod guestfs-actions.pod guestfs-availability.pod guestfs-structs.pod $(PODWRAPPER) \ - --section 3 \ + --no-strict-checks \ --man $@ \ + --section 3 \ + --license LGPLv2+ \ --insert $(srcdir)/guestfs-actions.pod:@ACTIONS@ \ --insert $(srcdir)/guestfs-availability.pod:@AVAILABILITY@ \ --insert $(srcdir)/guestfs-structs.pod:@STRUCTS@ \ @@ -67,23 +69,40 @@ guestfs.3: guestfs.pod guestfs-actions.pod guestfs-availability.pod guestfs-stru guestfish.1: guestfish.pod guestfish-actions.pod guestfish-commands.pod $(PODWRAPPER) \ + --no-strict-checks \ --man $@ \ + --license GPLv2+ \ --insert $(srcdir)/guestfish-actions.pod:@ACTIONS@ \ --insert $(srcdir)/guestfish-commands.pod:@FISH_COMMANDS@ \ $< virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.pod $(PODWRAPPER) \ + --no-strict-checks \ --man $@ \ + --license GPLv2+ \ --insert sysprep-extra-options.pod:@EXTRA_OPTIONS@ \ --insert sysprep-operations.pod:@OPERATIONS@ \ $< %.1: %.pod - $(PODWRAPPER) --man $@ $< + $(PODWRAPPER) \ + --no-strict-checks \ + --man $@ \ + $< + +%.3: %.pod + $(PODWRAPPER) \ + --no-strict-checks \ + --man $@ \ + --section 3 \ + $< %.1: %.pl - $(PODWRAPPER) --man $@ $< + $(PODWRAPPER) \ + --no-strict-checks \ + --man $@ \ + $< # Ensure that the first time we build from git, since guestfs.pod # hasn't been built yet, build it. 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 = |