[Rt-commit] rt branch, 4.0/static-docs, updated. rt-4.0.6-337-g86f1b7e

Thomas Sibley trs at bestpractical.com
Tue Oct 9 18:30:40 EDT 2012


The branch, 4.0/static-docs has been updated
       via  86f1b7e702724353416a6ae6308473e7603dc22b (commit)
      from  90119df81b29f0d22f6e360e65d7ab1dcfe3eb6b (commit)

Summary of changes:
 devel/tools/rt-static-docs | 44 ++++++++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 14 deletions(-)

- Log -----------------------------------------------------------------
commit 86f1b7e702724353416a6ae6308473e7603dc22b
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Oct 9 15:14:57 2012 -0700

    Upgrading docs are now POD, and should be processed as such
    
    3.8-era and older upgrading docs are in the root and are still manually
    converted from plain text to HTML.  This conveniently avoids the need to
    backport Alex's commit to update the upgrading formatting.
    
    An unfortunate workaround is needed for a Pod::Simple::Search
    limitation.

diff --git a/devel/tools/rt-static-docs b/devel/tools/rt-static-docs
index 2a19177..a03e775 100755
--- a/devel/tools/rt-static-docs
+++ b/devel/tools/rt-static-docs
@@ -88,17 +88,21 @@ if (($opts{rt} || '') =~ /\.tar\.gz$/ and -f $opts{rt}) {
 }
 chdir $opts{rt} if $opts{rt};
 
-my @dirs = (qw(
-    docs
-    etc
-    lib
-    bin
-    sbin
-    devel/tools
-    local/lib
-    local/sbin
-    local/bin
-), glob("local/plugins/*/{lib,sbin,bin}"));
+my @dirs = (
+    qw(
+        docs
+        etc
+        lib
+        bin
+        sbin
+        devel/tools
+        local/lib
+        local/sbin
+        local/bin
+    ),
+    glob("local/plugins/*/{lib,sbin,bin}"),
+    glob("docs/UPGRADING*"),
+);
 
 my $converter = RT::Pod::HTMLBatch->new;
 
@@ -129,9 +133,9 @@ else {
     warn "Unable to generate a page for ./configure --help!\n";
 }
 
-# Manually "convert" README* and docs/UPGRADING* to HTML and push them into the
-# known contents.
-for my $file (<README* docs/UPGRADING* UPGRADING*>) {
+# Manually "convert" README* and 3.8-era UPGRADING* to HTML and push them into
+# the known contents.
+for my $file (<README* UPGRADING*>) {
     (my $name = $file) =~ s{^.+/}{};
     my $dest = "$opts{to}/$name.html";
 
@@ -150,9 +154,21 @@ for my $file (<README* docs/UPGRADING* UPGRADING*>) {
     $converter->note_for_contents_file([$name], $file, $dest);
 }
 
+# Temporarily set executable bits on upgrading doc to work around
+# Pod::Simple::Search limitation/bug:
+#    https://rt.cpan.org/Ticket/Display.html?id=80082
+sub system_chmod {
+    system("chmod", @_) == 0
+        or die "Unable to chmod: $! (exit $?)";
+}
+system_chmod("+x", $_) for <docs/UPGRADING*>;
+
 # Convert each POD file to HTML
 $converter->batch_convert( \@dirs, $opts{to} );
 
+# Remove execution bit from workaround above
+system_chmod("-x", $_) for <docs/UPGRADING*>;
+
 # Need to chdir back out, if we are in the tmpdir, to let it clean up
 chdir "/" if $tmpdir;
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list