[Bps-public-commit] RT-Extension-MandatoryOnTransition branch, master, updated. 0.09_01-27-g3252705

Shawn Moore shawn at bestpractical.com
Mon Jul 11 16:34:56 EDT 2016


The branch, master has been updated
       via  325270508919a5a80c79ebc6c986d33230499dd1 (commit)
       via  bac35ee03a670c05bcfafb331618959ed9eaca2e (commit)
       via  a32c49be12edb9eac7b2dfcd3f17fb44db13abff (commit)
      from  8891d7203fd9be3afeb9874c9281e1349debe32b (commit)

Summary of changes:
 Changes                                   |  3 ++
 META.yml                                  |  3 +-
 Makefile.PL                               |  2 +
 inc/Module/Install/RTx.pm                 | 27 ++---------
 inc/Module/Install/ReadmeFromPod.pm       | 76 +++++++++++++++++++++++++------
 lib/RT/Extension/MandatoryOnTransition.pm |  2 +-
 6 files changed, 72 insertions(+), 41 deletions(-)

- Log -----------------------------------------------------------------
commit a32c49be12edb9eac7b2dfcd3f17fb44db13abff
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Mon Jul 11 20:34:10 2016 +0000

    Update Module::Install

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index cb4cfde..97acf77 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -37,13 +37,6 @@ sub RTx {
     }
     $self->add_metadata("x_module_install_rtx_version", $VERSION );
 
-    my $installdirs = $ENV{INSTALLDIRS};
-    for ( @ARGV ) {
-        if ( /INSTALLDIRS=(.*)/ ) {
-            $installdirs = $1;
-        }
-    }
-
     # Try to find RT.pm
     my @prefixes = qw( /opt /usr/local /home /usr /sw /usr/share/request-tracker4);
     $ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME};
@@ -78,13 +71,7 @@ sub RTx {
 
     # Installation locations
     my %path;
-    my $plugin_path;
-    if ( $installdirs && $installdirs eq 'vendor' ) {
-        $plugin_path = $RT::PluginPath;
-    } else {
-        $plugin_path = $RT::LocalPluginPath;
-    }
-    $path{$_} = $plugin_path . "/$name/$_"
+    $path{$_} = $RT::LocalPluginPath . "/$name/$_"
         foreach @DIRS;
 
     # Copy RT 4.2.0 static files into NoAuth; insufficient for
@@ -98,7 +85,7 @@ sub RTx {
     my %index = map { $_ => 1 } @INDEX_DIRS;
     $self->no_index( directory => $_ ) foreach grep !$index{$_}, @DIRS;
 
-    my $args = join ', ', map "q($_)", map { ($_, "\$(DESTDIR)$path{$_}") }
+    my $args = join ', ', map "q($_)", map { ($_, $path{$_}) }
         sort keys %path;
 
     printf "%-10s => %s\n", $_, $path{$_} for sort keys %path;
@@ -144,7 +131,6 @@ install ::
     if ( $path{lib} ) {
         $self->makemaker_args( INSTALLSITELIB => $path{'lib'} );
         $self->makemaker_args( INSTALLARCHLIB => $path{'lib'} );
-        $self->makemaker_args( INSTALLVENDORLIB => $path{'lib'} )
     } else {
         $self->makemaker_args( PM => { "" => "" }, );
     }
@@ -153,13 +139,6 @@ install ::
     $self->makemaker_args( INSTALLSITEMAN3DIR => "$RT::LocalPath/man/man3" );
     $self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
 
-    # INSTALLDIRS=vendor should install manpages into /usr/share/man.
-    # That is the default path in most distributions. Need input from
-    # Redhat, Centos etc.
-    $self->makemaker_args( INSTALLVENDORMAN1DIR => "/usr/share/man/man1" );
-    $self->makemaker_args( INSTALLVENDORMAN3DIR => "/usr/share/man/man3" );
-    $self->makemaker_args( INSTALLVENDORARCH => "/usr/share/man" );
-
     if (%has_etc) {
         print "For first-time installation, type 'make initdb'.\n";
         my $initdb = '';
@@ -279,4 +258,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 428
+#line 390
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index b5e03c3..3634ee0 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,12 +7,41 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.22';
+$VERSION = '0.26';
+
+{
+
+    # these aren't defined until after _require_admin is run, so
+    # define them so prototypes are available during compilation.
+    sub io;
+    sub capture(&;@);
+
+#line 28
+
+    my $done = 0;
+
+    sub _require_admin {
+
+	# do this once to avoid redefinition warnings from IO::All
+	return if $done;
+
+	require IO::All;
+	IO::All->import( '-binary' );
+
+	require Capture::Tiny;
+	Capture::Tiny->import ( 'capture' );
+
+	return;
+    }
+
+}
 
 sub readme_from {
   my $self = shift;
   return unless $self->is_admin;
 
+  _require_admin;
+
   # Input file
   my $in_file  = shift || $self->_all_from
     or die "Can't determine file to make readme_from";
@@ -50,6 +79,8 @@ sub readme_from {
     $out_file = $self->_readme_htm($in_file, $out_file, $options);
   } elsif ($format eq 'man') {
     $out_file = $self->_readme_man($in_file, $out_file, $options);
+  } elsif ($format eq 'md') {
+    $out_file = $self->_readme_md($in_file, $out_file, $options);
   } elsif ($format eq 'pdf') {
     $out_file = $self->_readme_pdf($in_file, $out_file, $options);
   }
@@ -67,10 +98,10 @@ sub _readme_txt {
   $out_file ||= 'README';
   require Pod::Text;
   my $parser = Pod::Text->new( @$options );
-  open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
+  my $io = io->file($out_file)->open(">");
+  my $out_fh = $io->io_handle;
   $parser->output_fh( *$out_fh );
   $parser->parse_file( $in_file );
-  close $out_fh;
   return $out_file;
 }
 
@@ -79,11 +110,14 @@ sub _readme_htm {
   my ($self, $in_file, $out_file, $options) = @_;
   $out_file ||= 'README.htm';
   require Pod::Html;
-  Pod::Html::pod2html(
-    "--infile=$in_file",
-    "--outfile=$out_file",
-    @$options,
-  );
+  my ($o) = capture {
+    Pod::Html::pod2html(
+      "--infile=$in_file",
+      "--outfile=-",
+      @$options,
+    );
+  };
+  io->file($out_file)->print($o);
   # Remove temporary files if needed
   for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
     if (-e $file) {
@@ -99,7 +133,10 @@ sub _readme_man {
   $out_file ||= 'README.1';
   require Pod::Man;
   my $parser = Pod::Man->new( @$options );
-  $parser->parse_from_file($in_file, $out_file);
+  my $io = io->file($out_file)->open(">");
+  my $out_fh = $io->io_handle;
+  $parser->output_fh( *$out_fh );
+  $parser->parse_file( $in_file );
   return $out_file;
 }
 
@@ -111,11 +148,20 @@ sub _readme_pdf {
     or die "Could not generate $out_file because pod2pdf could not be found\n";
   my $parser = App::pod2pdf->new( @$options );
   $parser->parse_from_file($in_file);
-  open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
-  select $out_fh;
-  $parser->output;
-  select STDOUT;
-  close $out_fh;
+  my ($o) = capture { $parser->output };
+  io->file($out_file)->print($o);
+  return $out_file;
+}
+
+sub _readme_md {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $out_file ||= 'README.md';
+  require Pod::Markdown;
+  my $parser = Pod::Markdown->new( @$options );
+  my $io = io->file($out_file)->open(">");
+  my $out_fh = $io->io_handle;
+  $parser->output_fh( *$out_fh );
+  $parser->parse_file( $in_file );
   return $out_file;
 }
 
@@ -134,5 +180,5 @@ sub _all_from {
 
 __END__
 
-#line 254
+#line 316
 

commit bac35ee03a670c05bcfafb331618959ed9eaca2e
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Mon Jul 11 20:34:36 2016 +0000

    Add repository metadata

diff --git a/Makefile.PL b/Makefile.PL
index 64a2f31..de06f53 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,6 +5,8 @@ RTx 'RT-Extension-MandatoryOnTransition';
 no_index package => "RT::Extension::MandatoryOnTransition::Test";
 license  'gplv2';
 
+repository('https://github.com/bestpractical/rt-extension-mandatoryontransition');
+
 requires_rt('4.0.9');
 
 my ($lp) = ($INC{'RT.pm'} =~ /^(.*)[\\\/]/);

commit 325270508919a5a80c79ebc6c986d33230499dd1
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Mon Jul 11 20:34:50 2016 +0000

    0.12 releng

diff --git a/Changes b/Changes
index 63016a6..b3958be 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+0.12 2016-07-11
+ - Packaging improvements
+
 0.11 2016-06-30
  - Allow rules to require or restrict specific values on transition
 
diff --git a/META.yml b/META.yml
index b2c9e29..0781b5a 100644
--- a/META.yml
+++ b/META.yml
@@ -26,6 +26,7 @@ requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: '0.10'
+  repository: https://github.com/bestpractical/rt-extension-mandatoryontransition
+version: '0.12'
 x_module_install_rtx_version: '0.37'
 x_requires_rt: 4.0.9
diff --git a/lib/RT/Extension/MandatoryOnTransition.pm b/lib/RT/Extension/MandatoryOnTransition.pm
index 4a8feb6..4a83f7d 100644
--- a/lib/RT/Extension/MandatoryOnTransition.pm
+++ b/lib/RT/Extension/MandatoryOnTransition.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::MandatoryOnTransition;
 
-our $VERSION = '0.11';
+our $VERSION = '0.12';
 
 =head1 NAME
 

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


More information about the Bps-public-commit mailing list