]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1158563: makedocs.pl is unable to load File::Copy::Recursive installed in bugzill...
authorFrédéric Buclin <LpSolit@gmail.com>
Thu, 30 Apr 2015 15:10:08 +0000 (17:10 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Thu, 30 Apr 2015 15:10:08 +0000 (17:10 +0200)
r=dkl a=glob

Bugzilla/Install/Requirements.pm
docs/lib/Pod/Simple/HTML/Bugzilla.pm
docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm
docs/makedocs.pl
t/011pod.t
t/Support/Files.pm

index 797f8545320ae23569127dabaecb5ae37d4b0f06..4dbb0caef22fe99c23b4e65d233979ddc1d3ab85 100644 (file)
@@ -462,6 +462,7 @@ use constant FEATURE_FILES => (
     moving        => ['importxml.pl'],
     auth_ldap     => ['Bugzilla/Auth/Verify/LDAP.pm'],
     auth_radius   => ['Bugzilla/Auth/Verify/RADIUS.pm'],
+    documentation => ['docs/makedocs.pl'],
     inbound_email => ['email_in.pl'],
     jobqueue      => ['Bugzilla/Job/*', 'Bugzilla/JobQueue.pm',
                       'Bugzilla/JobQueue/*', 'jobqueue.pl'],
index 66e1d7b59bc93fe7f75c461f64303755e3ba5b1b..ffbd0775c11482130e5e6db30fe25c84095d23a6 100644 (file)
@@ -9,6 +9,7 @@ package Pod::Simple::HTML::Bugzilla;
 
 use 5.10.1;
 use strict;
+use warnings;
 
 use parent qw(Pod::Simple::HTML);
 
index bc60d0374ad087c70b6c4f621a94227e6f6efd02..cb61082df6e535147f5ac9ab92dd47d94b99bb06 100644 (file)
@@ -9,6 +9,7 @@ package Pod::Simple::HTMLBatch::Bugzilla;
 
 use 5.10.1;
 use strict;
+use warnings;
 
 use parent qw(Pod::Simple::HTMLBatch);
 
index 31ad0c6108cddea6d3743c814732897359506b4b..6f353dc6dad04c36ac3d2a730878e3afa63a660f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use 5.10.1;
 use strict;
+use warnings;
 
-use Cwd;
-use File::Find;
 use File::Basename;
-use File::Copy::Recursive qw(rcopy);
-
-# We need to be in this directory to use our libraries.
-BEGIN {
-    require File::Basename;
-    import File::Basename qw(dirname);
-    chdir dirname($0);
-}
+BEGIN { chdir dirname($0); }
 
 use lib qw(.. ../lib lib);
 
-# We only compile our POD if Pod::Simple is installed. We do the checks
-# this way so that if there's a compile error in Pod::Simple::HTML::Bugzilla,
-# makedocs doesn't just silently fail, but instead actually tells us there's
-# a compile error.
-my $pod_simple;
-if (eval { require Pod::Simple }) {
-    require Pod::Simple::HTMLBatch::Bugzilla;
-    require Pod::Simple::HTML::Bugzilla;
-    $pod_simple = 1;
-};
-
-use Bugzilla::Constants qw(BUGZILLA_VERSION bz_locations);
-
+use Cwd;
+use File::Copy::Recursive qw(rcopy);
+use File::Find;
 use File::Path qw(rmtree);
 use File::Which qw(which);
+use Pod::Simple;
+
+use Bugzilla::Constants qw(BUGZILLA_VERSION bz_locations);
+use Pod::Simple::HTMLBatch::Bugzilla;
+use Pod::Simple::HTML::Bugzilla;
 
 ###############################################################################
 # Subs
@@ -65,8 +52,8 @@ sub MakeDocs {
     my ($name, $cmdline) = @_;
 
     say "Creating $name documentation ..." if defined $name;
-    say "$cmdline\n";
-    system($cmdline) == 0
+    say "make $cmdline\n";
+    system('make', $cmdline) == 0
         or $error_found = 1;
     print "\n";
 }
@@ -125,7 +112,7 @@ my $docparent = getcwd();
 foreach my $lang (@langs) {
     chdir "$docparent/$lang";
 
-    make_pod() if $pod_simple;
+    make_pod();
 
     next if grep { $_ eq '--pod-only' } @ARGV;
 
@@ -144,10 +131,7 @@ foreach my $lang (@langs) {
     }
 
     # Collect up local extension documentation into the extensions/ dir.
-    # Clear out old extensions docs
-    # For the life of me, I cannot get rmtree() to work here. It just returns
-    # silently without deleting anything - no errors.
-    system("rm -rf $lang/rst/extensions/*");
+    rmtree("$lang/rst/extensions", 0, 1);
 
     foreach my $ext_name (keys %extensions) {
         my $src = $extensions{$ext_name} . "/*";
@@ -158,16 +142,16 @@ foreach my $lang (@langs) {
 
     chdir "$docparent/$lang";
 
-    MakeDocs('HTML', 'make html');
-    MakeDocs('TXT', 'make text');
+    MakeDocs('HTML', 'html');
+    MakeDocs('TXT', 'text');
 
     if (grep { $_ eq '--with-pdf' } @ARGV) {
         if (which('pdflatex')) {
-            MakeDocs('PDF', 'make latexpdf');
+            MakeDocs('PDF', 'latexpdf');
         }
         elsif (which('rst2pdf')) {
             rmtree('pdf', 0, 1);
-            MakeDocs('PDF', 'make pdf');
+            MakeDocs('PDF', 'pdf');
         }
         else {
             say 'pdflatex or rst2pdf not found. Skipping PDF file creation';
index 71294dfe601e6497b5c6f757c8217c4ab8daa280..9c092eeb1165ef825a11629edc0125ce6b95f010 100644 (file)
@@ -49,6 +49,7 @@ use constant MODULE_WHITELIST => qw(
     Bugzilla::Extension::
     Bugzilla::Job::
     Bugzilla::Migrate::
+    docs::lib::Pod::Simple::
 );
 
 # Capture the TESTOUT from Test::More or Test::Builder for printing errors.
index 85fa9f5839da3775919cb181c8ea8af195c90e27..f3fae58fc6859765d2608c5edd20b83eff5f0dd1 100644 (file)
@@ -17,8 +17,8 @@ use File::Find;
 our @additional_files = ();
 
 our @files = glob('*');
-find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla');
-push(@files, 'extensions/create.pl');
+find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, qw(Bugzilla docs));
+push(@files, 'extensions/create.pl', 'docs/makedocs.pl');
 
 our @extensions =
     grep { $_ ne 'extensions/create.pl' && ! -e "$_/disabled" }