[Bps-public-commit] rt-extension-tags branch, update-for-rt5, created. 0.03-5-g38b6f9a

Aaron Trevena ast at bestpractical.com
Tue Jul 7 12:44:31 EDT 2020


The branch, update-for-rt5 has been created
        at  38b6f9af305f8c4996971ca4c66c4fe95e312849 (commit)

- Log -----------------------------------------------------------------
commit 4d816f29df61b7ca9481467fd757f88ae4f40dcd
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Aug 5 15:26:00 2016 -0400

    Add docs for upgrading from 0.01 or 0.02

diff --git a/README b/README
index 8725bb2..b692544 100644
--- a/README
+++ b/README
@@ -3,28 +3,15 @@ NAME
 
 DESCRIPTION
     This extension allows you to create tags using custom fields on tickets.
-    RT has a custom field type that allows you to select multiple values
-    with autocomplete from a list of values. This extension allows users to
-    add new values (tags) that will then be added to the list of available
+    It adds a new custom field type, "Tags", which allows users to add new
+    values (tags) that will then be added to the list of available
     autocomplete values for that custom field.
 
     The created tags become links to a search of all active tickets with
     that tag.
 
   Tag Custom Field
-    The initdb step installs a Tag custom field by default along with the
-    required condition, action, and scrip. The custom field is global as
-    installed, but you can limit it to specific queues by editing the custom
-    field configuration.
-
-    If you want to use this functionality with a different custom field,
-    create the custom field, then create a new scrip. You can use the
-    provided "On Custom Field Change" condition as is. Then create a new
-    action in the RT database using the same values as the provided "Add New
-    CF Value" but change the Argument to the name of your new custom field.
-    You can add this with a short initial data file, directly in the
-    database, or using the helpful extension
-    RT::Extension::AdminConditionsAndActions.
+    The initdb step installs an example global Tag custom field.
 
 RT VERSION
     Works with RT 4.0, 4.2, 4.4
@@ -36,9 +23,7 @@ INSTALLATION
         May need root permissions
 
     make initdb
-        Only run this the first time you install the module. Creates a
-        global Tags custom field and adds the necessary scrip, action, and
-        condition.
+        This optional step installs an example global Tag custom field.
 
     Edit your /opt/rt4/etc/RT_SiteConfig.pm
         If you are using RT 4.2 or greater, add this line:
@@ -56,6 +41,22 @@ INSTALLATION
 
     Restart your webserver
 
+  UPGRADING
+    If you are upgrading from version 0.01 or 0.02, note that the custom
+    field type was changed from a default RT "multiple values with
+    autocompletion" to a dedicated tag custom field type. To upgrade:
+
+    *   Change your Tag custom field to use the new tag custom field type
+
+        You can either edit your existing custom field and change the Type
+        to "Enter multiple tags" or run the initdb step and copy your values
+        to the new Tag custom field automatically created.
+
+    *   Disable the scrip "On Custom Field Change Add New Tag Values"
+
+        This scrip is no longer needed with the new tag custom field type,
+        so you can disable or delete it.
+
 AUTHOR
     Best Practical Solutions, LLC <modules at bestpractical.com>
 
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index d5dba3b..60fa129 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -104,6 +104,27 @@ or add C<RT::Extension::Tags> to your existing C<@Plugins> line.
 
 =back
 
+=head2 UPGRADING
+
+If you are upgrading from version 0.01 or 0.02, note that the custom field
+type was changed from a default RT "multiple values with autocompletion" to
+a dedicated tag custom field type. To upgrade:
+
+=over
+
+=item * Change your Tag custom field to use the new tag custom field type
+
+You can either edit your existing custom field and change the Type to "Enter
+multiple tags" or run the initdb step and copy your values to the new Tag
+custom field automatically created.
+
+=item * Disable the scrip "On Custom Field Change Add New Tag Values"
+
+This scrip is no longer needed with the new tag custom field type,
+so you can disable or delete it.
+
+=back
+
 =head1 AUTHOR
 
 Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>

commit 1b1d8a5be9141a3fd98c78a379bf9b7175a90a8f
Merge: 4d816f2 457c710
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Aug 8 11:21:26 2016 -0400

    Merge branch 'tagit'


commit 4f359c4ed371f87d1376e0fed3d44cb6bc49e55b
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Aug 8 11:29:12 2016 -0400

    Prep for 0.03 release

diff --git a/Changes b/Changes
index d0b0682..9ac258f 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,14 @@
 Revision history for RT-Extension-Tags
 
+0.03 2016-08-08
+
+ - Create a new RT custom field type for tags to use in place of
+   RT's multiple select type. Add javascript tagit library to enhance
+   UI when selecting tags.
+
+   Note: the CF type change requires manual updates if you installed
+   previous versions. See the Upgrade notes for details.
+
 0.02 2016-07-13
 
  - Contributions from Alex Vandiver to remove the custom condition,
diff --git a/MANIFEST b/MANIFEST
index f6875cd..be2b8e2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,5 +1,7 @@
 Changes
 etc/initialdata
+html/Elements/EditCustomFieldTags
+html/Elements/ShowCustomFieldTags
 inc/Module/Install.pm
 inc/Module/Install/Base.pm
 inc/Module/Install/Can.pm
@@ -13,9 +15,10 @@ inc/Module/Install/RTx/Runtime.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
 inc/YAML/Tiny.pm
-lib/RT/Action/AddNewCFValue.pm
 lib/RT/Extension/Tags.pm
 Makefile.PL
 MANIFEST			This list of files
 META.yml
 README
+static/css/jquery.tagit.css
+static/js/tag-it.min.js
diff --git a/META.yml b/META.yml
index df0bad6..ffc8ee6 100644
--- a/META.yml
+++ b/META.yml
@@ -17,13 +17,15 @@ name: RT-Extension-Tags
 no_index:
   directory:
     - etc
+    - html
     - inc
+    - static
 requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-tags
-version: '0.02'
+version: '0.03'
 x_module_install_rtx_version: '0.37'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.6.0
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index 570ba52..10d9c75 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::Tags;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 
 require RT::CustomField;

commit c63a21364c6c7b9ba831935adf7eca0cc4eabc07
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Feb 20 10:38:39 2017 -0500

    Determine input name from Name or NamePrefix
    
    Determine the tag form field input name from the passed in Name
    or NamePrefix using the same evaluation as other custom field
    inputs, consistent with 4b21442ed.

diff --git a/html/Elements/EditCustomFieldTags b/html/Elements/EditCustomFieldTags
index e26993f..d679175 100644
--- a/html/Elements/EditCustomFieldTags
+++ b/html/Elements/EditCustomFieldTags
@@ -1,17 +1,18 @@
-<textarea name="<% $name %>-Values" id="<% $name %>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea>
+<textarea name="<% $name %>" id="<% $name %>" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea>
 <script type="text/javascript">
-var id = <% "$name-Values" |n,j%>;
+var id = <% "$name" |n,j%>;
 id = id.replace(/:/g,'\\:');
 jQuery('#'+id).tagit({
   autocomplete: {
-    source: <%RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Values" |n,u,j%>,
+    source: <%RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name" |n,u,j%>,
   },
   tagLimit: <% $CustomField->MaxValues+0 || "null" |n %>,
   singleFieldDelimiter: "\n"
 });
 </script>
 <%INIT>
-my $name = $NamePrefix . $CustomField->Id;
+my $name = $Name || $NamePrefix . $CustomField->Id . '-Values';
+
 if ( $Default && !$Multiple ) {
     $Default =~ s/\s*\r*\n\s*/ /g;
 }
@@ -35,4 +36,5 @@ $Values      => undef
 $Multiple    => undef
 $Rows        => undef
 $Cols        => undef
+$Name        => undef
 </%ARGS>

commit 703bb0f2672bdaa63c55caee39cb30cd540da9a7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Feb 20 10:50:39 2017 -0500

    Module::Install updates

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index cb4cfde..80538d3 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.37';
+our $VERSION = '0.38';
 
 use FindBin;
 use File::Glob     ();
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 6189771c2db47fcdb54b42d3115e2960c9ca0248
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon Feb 20 10:52:13 2017 -0500

    Prep for 0.04 release

diff --git a/Changes b/Changes
index 9ac258f..0a932f6 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for RT-Extension-Tags
 
+0.04 2017-02-20
+
+ - Update tag input elements to be consistent with usage in RT 4.2, 4.4
+
 0.03 2016-08-08
 
  - Create a new RT custom field type for tags to use in place of
diff --git a/META.yml b/META.yml
index ffc8ee6..7a3a341 100644
--- a/META.yml
+++ b/META.yml
@@ -25,7 +25,7 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-tags
-version: '0.03'
-x_module_install_rtx_version: '0.37'
+version: '0.04'
+x_module_install_rtx_version: '0.38'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.6.0
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index 10d9c75..f0d0a34 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::Tags;
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 
 require RT::CustomField;

commit c96c553c876795d36f321d7b1585eaf8beb72c09
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Feb 28 06:24:28 2019 +0800

    Update inc

diff --git a/META.yml b/META.yml
index 7a3a341..22eb085 100644
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ configure_requires:
   ExtUtils::MakeMaker: 6.59
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.16'
+generated_by: 'Module::Install version 1.19'
 license: gplv2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -26,6 +26,6 @@ resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-tags
 version: '0.04'
-x_module_install_rtx_version: '0.38'
+x_module_install_rtx_version: '0.40'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.6.0
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index f44ab4d..7ba98c2 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -244,6 +244,8 @@ sub new {
 	}
 	return $args{_self} if $args{_self};
 
+	$base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
+
 	$args{dispatch} ||= 'Admin';
 	$args{prefix}   ||= 'inc';
 	$args{author}   ||= ($^O eq 'VMS' ? '_author' : '.author');
@@ -322,7 +324,7 @@ sub find_extensions {
 	my ($self, $path) = @_;
 
 	my @found;
-	File::Find::find( sub {
+	File::Find::find( {no_chdir => 1, wanted => sub {
 		my $file = $File::Find::name;
 		return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
 		my $subpath = $1;
@@ -336,7 +338,7 @@ sub find_extensions {
 		# correctly.  Otherwise, root through the file to locate the case-preserved
 		# version of the package name.
 		if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
-			my $content = Module::Install::_read($subpath . '.pm');
+			my $content = Module::Install::_read($File::Find::name);
 			my $in_pod  = 0;
 			foreach ( split /\n/, $content ) {
 				$in_pod = 1 if /^=\w/;
@@ -351,7 +353,7 @@ sub find_extensions {
 		}
 
 		push @found, [ $file, $pkg ];
-	}, $path ) if -d $path;
+	}}, $path ) if -d $path;
 
 	@found;
 }
@@ -373,8 +375,6 @@ sub _caller {
 	return $call;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
 	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
@@ -383,16 +383,6 @@ sub _read {
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
-END_NEW
-sub _read {
-	local *FH;
-	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	binmode FH;
-	my $string = do { local $/; <FH> };
-	close FH or die "close($_[0]): $!";
-	return $string;
-}
-END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -413,8 +403,6 @@ sub _readpod {
 	return $string;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
 	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
@@ -424,17 +412,6 @@ sub _write {
 	}
 	close FH or die "close($_[0]): $!";
 }
-END_NEW
-sub _write {
-	local *FH;
-	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
-	binmode FH;
-	foreach ( 1 .. $#_ ) {
-		print FH $_[$_] or die "print($_[0]): $!";
-	}
-	close FH or die "close($_[0]): $!";
-}
-END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 5762a74..9fa42c2 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index d859276..d65c753 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -121,6 +121,15 @@ END_C
 # Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
+
+	if ($^O eq 'VMS') {
+		require ExtUtils::CBuilder;
+		my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+		);
+		return $builder->have_compiler;
+	}
+
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
 
 	# $Config{cc} may contain args; try to find out the program part
@@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 236
+#line 245
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 41d3517..3072b08 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index 2eb1d1f..13fdcd0 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index e9918d2..13a4464 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 9792685..11bf971 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 80538d3..7cad529 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.38';
+our $VERSION = '0.40';
 
 use FindBin;
 use File::Glob     ();
@@ -113,11 +113,29 @@ lexicons ::
 .
     }
 
+    my $remove_files;
+    if( $extra_args->{'remove_files'} ){
+        $self->include('Module::Install::RTx::Remove');
+        our @remove_files;
+        eval { require "etc/upgrade/remove_files" }
+          or print "No remove file located, no files to remove\n";
+        $remove_files = join ",", map {"q(\$(DESTDIR)$plugin_path/$name/$_)"} @remove_files;
+    }
+
     $self->include('Module::Install::RTx::Runtime') if $self->admin;
     $self->include_deps( 'YAML::Tiny', 0 ) if $self->admin;
     my $postamble = << ".";
 install ::
 \t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxPlugin()"
+.
+
+    if( $remove_files ){
+        $postamble .= << ".";
+\t\$(NOECHO) \$(PERL) -MModule::Install::RTx::Remove -e \"RTxRemove([$remove_files])\"
+.
+    }
+
+    $postamble .= << ".";
 \t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
 .
 
@@ -279,4 +297,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 428
+#line 468
diff --git a/inc/Module/Install/RTx/Runtime.pm b/inc/Module/Install/RTx/Runtime.pm
index 937949f..ae07502 100644
--- a/inc/Module/Install/RTx/Runtime.pm
+++ b/inc/Module/Install/RTx/Runtime.pm
@@ -33,6 +33,7 @@ sub RTxDatabase {
 
     my $lib_path = File::Basename::dirname($INC{'RT.pm'});
     my @args = (
+        "-I.",
         "-Ilib",
         "-I$RT::LocalLibPath",
         "-I$lib_path",
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 3634ee0..3738232 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,7 +7,7 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.26';
+$VERSION = '0.30';
 
 {
 
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 218a66b..f7aa615 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 530749b..2db861a 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
diff --git a/inc/YAML/Tiny.pm b/inc/YAML/Tiny.pm
index aa539f7..fb157a6 100644
--- a/inc/YAML/Tiny.pm
+++ b/inc/YAML/Tiny.pm
@@ -2,12 +2,12 @@
 use 5.008001; # sane UTF-8 support
 use strict;
 use warnings;
-package YAML::Tiny; # git description: v1.68-2-gcc5324e
+package YAML::Tiny; # git description: v1.72-7-g8682f63
 # XXX-INGY is 5.8.1 too old/broken for utf8?
 # XXX-XDG Lancaster consensus was that it was sufficient until
 # proven otherwise
 
-our $VERSION = '1.69';
+our $VERSION = '1.73';
 
 #####################################################################
 # The YAML::Tiny API.
@@ -374,7 +374,7 @@ sub _load_scalar {
     while ( @$lines ) {
         $lines->[0] =~ /^(\s*)/;
         last unless length($1) >= $indent->[-1];
-        push @multiline, substr(shift(@$lines), length($1));
+        push @multiline, substr(shift(@$lines), $indent->[-1]);
     }
 
     my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
@@ -570,10 +570,8 @@ sub _dump_file {
     if ( _can_flock() ) {
         # Open without truncation (truncate comes after lock)
         my $flags = Fcntl::O_WRONLY()|Fcntl::O_CREAT();
-        sysopen( $fh, $file, $flags );
-        unless ( $fh ) {
-            $self->_error("Failed to open file '$file' for writing: $!");
-        }
+        sysopen( $fh, $file, $flags )
+            or $self->_error("Failed to open file '$file' for writing: $!");
 
         # Use no translation and strict UTF-8
         binmode( $fh, ":raw:encoding(UTF-8)");
@@ -871,4 +869,4 @@ delete $YAML::Tiny::{refaddr};
 
 __END__
 
-#line 1489
+#line 1487

commit 38b6f9af305f8c4996971ca4c66c4fe95e312849
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Feb 28 06:33:11 2019 +0800

    Put "make initdb" after enabling the plugin
    
    The "Tag" custom field in initialdata needs the new "Tags" type, so we
    need to enable the plugin first.

diff --git a/README b/README
index b692544..c19e3af 100644
--- a/README
+++ b/README
@@ -22,9 +22,6 @@ INSTALLATION
     make install
         May need root permissions
 
-    make initdb
-        This optional step installs an example global Tag custom field.
-
     Edit your /opt/rt4/etc/RT_SiteConfig.pm
         If you are using RT 4.2 or greater, add this line:
 
@@ -36,6 +33,9 @@ INSTALLATION
 
         or add RT::Extension::Tags to your existing @Plugins line.
 
+    make initdb
+        This optional step installs an example global Tag custom field.
+
     Clear your mason cache
             rm -rf /opt/rt4/var/mason_data/obj
 
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index f0d0a34..34aac6e 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -82,10 +82,6 @@ Works with RT 4.0, 4.2, 4.4
 
 May need root permissions
 
-=item C<make initdb>
-
-This optional step installs an example global C<Tag> custom field.
-
 =item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
 
 If you are using RT 4.2 or greater, add this line:
@@ -98,6 +94,10 @@ For RT 4.0, add this line:
 
 or add C<RT::Extension::Tags> to your existing C<@Plugins> line.
 
+=item C<make initdb>
+
+This optional step installs an example global C<Tag> custom field.
+
 =item Clear your mason cache
 
     rm -rf /opt/rt4/var/mason_data/obj

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


More information about the Bps-public-commit mailing list