diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2014-01-21 17:36:46 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2014-01-21 17:36:46 +0100 |
commit | 38c3cfbf27bf62e63e955cbab80783ea11b40b06 (patch) | |
tree | 213302271de3b5499e6803f461084bd79c94bb1a /docs/makedocs.pl | |
parent | 91ae795be29e4ab48da994e1e33c21b2d3c524b5 (diff) | |
download | bugzilla-38c3cfbf27bf62e63e955cbab80783ea11b40b06.tar.gz bugzilla-38c3cfbf27bf62e63e955cbab80783ea11b40b06.tar.xz |
Bug 961398: Let rst2pdf build the PDF documentation if pdflatex is not available
r=gerv a=glob
Diffstat (limited to 'docs/makedocs.pl')
-rwxr-xr-x | docs/makedocs.pl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/makedocs.pl b/docs/makedocs.pl index e46f7e7da..2fc6721eb 100755 --- a/docs/makedocs.pl +++ b/docs/makedocs.pl @@ -50,6 +50,9 @@ use Bugzilla::Install::Requirements qw(REQUIRED_MODULES OPTIONAL_MODULES); use Bugzilla::Constants qw(DB_MODULE BUGZILLA_VERSION); +use File::Path qw(rmtree); +use File::Which qw(which); + ############################################################################### # Generate minimum version list ############################################################################### @@ -174,5 +177,17 @@ foreach my $lang (@langs) { MakeDocs('HTML', 'make html'); MakeDocs('TXT', 'make text'); - MakeDocs('PDF', 'make latexpdf') if grep { $_ eq '--with-pdf' } @ARGV; + + if (grep { $_ eq '--with-pdf' } @ARGV) { + if (which('pdflatex')) { + MakeDocs('PDF', 'make latexpdf'); + } + elsif (which('rst2pdf')) { + rmtree('pdf', 0, 1); + MakeDocs('PDF', 'make pdf'); + } + else { + say 'pdflatex or rst2pdf not found. Skipping PDF file creation'; + } + } } |