[Bps-public-commit] RT-Extension-RepliesToResolved branch master updated. 1.01-7-g088d75e

BPS Git Server git at git.bestpractical.com
Thu Feb 24 17:36:08 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "RT-Extension-RepliesToResolved".

The branch, master has been updated
       via  088d75e527145aedce9c25982fe508b27e73af5a (commit)
       via  a2b04cb6c5565724fa38bc85e7854010b523e23c (commit)
       via  32aa30ddc89ba929fb0580a71fad31cefed6052d (commit)
       via  7b283cae3e77f21719d877f7b35bfdf6d2768937 (commit)
      from  37c5af5763f323352e941dd2e0c120f8e7f08d0a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 088d75e527145aedce9c25982fe508b27e73af5a
Merge: 37c5af5 a2b04cb
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Feb 25 01:33:01 2022 +0800

    Merge branch 'update-for-rt5'


commit a2b04cb6c5565724fa38bc85e7854010b523e23c
Author: Brad Embree <brad at bestpractical.com>
Date:   Fri Jan 14 15:15:33 2022 -0800

    Prep version 1.03

diff --git a/Changes b/Changes
index 65d01cc..6a0e224 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+1.03 2022-02-24
+ - Add RT 5 compatibility
+
 1.02 2018-06-13
  - Allow install on RT 4.4
 
diff --git a/META.yml b/META.yml
index 44fac19..e6c1a99 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-repliestoresolved
-version: '1.02'
+version: '1.03'
 x_module_install_rtx_version: '0.43'
 x_requires_rt: 4.0.9
-x_rt_too_new: 4.6.0
+x_rt_too_new: 5.2.0
diff --git a/Makefile.PL b/Makefile.PL
index 43efd8b..2f4def8 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -7,7 +7,7 @@ repository('https://github.com/bestpractical/rt-extension-repliestoresolved');
 no_index( package => 'RT::Interface::Email' );
 
 requires_rt '4.0.9';
-rt_too_new  '4.6.0';
+rt_too_new  '5.2.0';
 
 license 'gplv2';
 
diff --git a/README b/README
index fc67381..d34220b 100644
--- a/README
+++ b/README
@@ -1,6 +1,9 @@
 NAME
     RT::Extension::RepliesToResolved - intercept replies to resolved tickets
 
+RT VERSION
+    Works with RT 4.4, 5.0
+
 DESCRIPTION
     Intercepts replies via email to resolved tickets, and creates a new
     ticket rather than updating the resolved ticket. There are a few reasons
@@ -24,7 +27,7 @@ INSTALLATION
         If you are upgrading this module, check for upgrading instructions
         in case changes need to be made to your database.
 
-    Edit your /opt/rt4/etc/RT_SiteConfig.pm
+    Edit your /opt/rt5/etc/RT_SiteConfig.pm
         If you are using RT 4.2 or greater, add this line:
 
             Plugin('RT::Extension::RepliesToResolved');
@@ -37,14 +40,14 @@ INSTALLATION
         line.
 
     Clear your mason cache
-            rm -rf /opt/rt4/var/mason_data/obj
+            rm -rf /opt/rt5/var/mason_data/obj
 
     Restart your webserver
 
 CONFIGURATION
     Configuration for this extension is defined in
 
-        /opt/rt4/local/plugins/RT-Extension-RepliesToResolved/etc/RepliesToResolved_Config.pm
+        /opt/rt5/local/plugins/RT-Extension-RepliesToResolved/etc/RepliesToResolved_Config.pm
 
     You can read about the options in that file and then set your own
     options in your RT_SiteConfig.pm file.
@@ -67,7 +70,7 @@ BUGS
         L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-RepliesToResolved>.
 
 LICENSE AND COPYRIGHT
-    This software is Copyright (c) 2014-2015 by Best Practical Solutions
+    This software is Copyright (c) 2014-2022 by Best Practical Solutions
 
     This is free software, licensed under:
 
diff --git a/lib/RT/Extension/RepliesToResolved.pm b/lib/RT/Extension/RepliesToResolved.pm
index f4d31b2..fe1f850 100644
--- a/lib/RT/Extension/RepliesToResolved.pm
+++ b/lib/RT/Extension/RepliesToResolved.pm
@@ -2,12 +2,16 @@ use 5.008003; use strict; use warnings;
 
 package RT::Extension::RepliesToResolved;
 
-our $VERSION = '1.02';
+our $VERSION = '1.03';
 
 =head1 NAME
 
 RT::Extension::RepliesToResolved - intercept replies to resolved tickets
 
+=head1 RT VERSION
+
+Works with RT 4.4, 5.0
+
 =head1 DESCRIPTION
 
 Intercepts replies via email to resolved tickets, and creates a new
@@ -44,7 +48,7 @@ in your database.
 If you are upgrading this module, check for upgrading instructions
 in case changes need to be made to your database.
 
-=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
+=item Edit your F</opt/rt5/etc/RT_SiteConfig.pm>
 
 If you are using RT 4.2 or greater, add this line:
 
@@ -58,7 +62,7 @@ or add C<RT::Extension::RepliesToResolved> to your existing C<@Plugins> line.
 
 =item Clear your mason cache
 
-    rm -rf /opt/rt4/var/mason_data/obj
+    rm -rf /opt/rt5/var/mason_data/obj
 
 =item Restart your webserver
 
@@ -68,7 +72,7 @@ or add C<RT::Extension::RepliesToResolved> to your existing C<@Plugins> line.
 
 Configuration for this extension is defined in
 
-    /opt/rt4/local/plugins/RT-Extension-RepliesToResolved/etc/RepliesToResolved_Config.pm
+    /opt/rt5/local/plugins/RT-Extension-RepliesToResolved/etc/RepliesToResolved_Config.pm
 
 You can read about the options in that file and then set your own
 options in your RT_SiteConfig.pm file.
@@ -161,7 +165,7 @@ or via the web at
 
 =head1 LICENSE AND COPYRIGHT
 
-This software is Copyright (c) 2014-2015 by Best Practical Solutions
+This software is Copyright (c) 2014-2022 by Best Practical Solutions
 
 This is free software, licensed under:
 

commit 32aa30ddc89ba929fb0580a71fad31cefed6052d
Author: Brad Embree <brad at bestpractical.com>
Date:   Fri Jan 14 15:14:23 2022 -0800

    Add dot to inc for Module::Install

diff --git a/Makefile.PL b/Makefile.PL
index 68d3b40..43efd8b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,3 +1,4 @@
+use lib '.';
 use inc::Module::Install;
 RTx('RT-Extension-RepliesToResolved');
 

commit 7b283cae3e77f21719d877f7b35bfdf6d2768937
Author: Brad Embree <brad at bestpractical.com>
Date:   Fri Jan 14 15:11:04 2022 -0800

    Update Module::Install

diff --git a/META.yml b/META.yml
index ecc21e4..44fac19 100644
--- a/META.yml
+++ b/META.yml
@@ -26,6 +26,6 @@ resources:
   license: http://opensource.org/licenses/gpl-license.php
   repository: https://github.com/bestpractical/rt-extension-repliestoresolved
 version: '1.02'
-x_module_install_rtx_version: '0.40'
+x_module_install_rtx_version: '0.43'
 x_requires_rt: 4.0.9
 x_rt_too_new: 4.6.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 7cad529..2889ece 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -6,9 +6,10 @@ use strict;
 use warnings;
 no warnings 'once';
 
+use Term::ANSIColor qw(:constants);
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.40';
+our $VERSION = '0.43';
 
 use FindBin;
 use File::Glob     ();
@@ -53,7 +54,7 @@ sub RTx {
         my @look = @INC;
         unshift @look, grep {defined and -d $_} @try;
         push @look, grep {defined and -d $_}
-            map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
+            map { ( "$_/rt5/lib", "$_/lib/rt5", "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
         last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
 
         warn
@@ -76,6 +77,22 @@ sub RTx {
         $self->requires_rt('4.0.0');
     }
 
+    my $package = $name;
+    $package =~ s/-/::/g;
+    if ( $RT::CORED_PLUGINS{$package} ) {
+        my ($base_version) = $RT::VERSION =~ /(\d+\.\d+\.\d+)/;
+        die RED, <<"EOT";
+
+**** Error: Your installed version of RT ($RT::VERSION) already
+            contains this extension in core, so you don't need to
+            install it.
+
+            Check https://docs.bestpractical.com/rt/$base_version/RT_Config.html
+            to configure it.
+
+EOT
+    }
+
     # Installation locations
     my %path;
     my $plugin_path;
@@ -117,7 +134,7 @@ lexicons ::
     if( $extra_args->{'remove_files'} ){
         $self->include('Module::Install::RTx::Remove');
         our @remove_files;
-        eval { require "etc/upgrade/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;
     }
@@ -223,7 +240,7 @@ sub requires_rt {
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
-        die <<"EOT";
+        die RED, <<"EOT";
 
 **** Error: This extension requires RT $version. Your installed version
             of RT ($RT::VERSION) is too old.
@@ -249,12 +266,12 @@ sub requires_rt_plugin {
         unshift @INC, $path;
     } else {
         my $name = $self->name;
-        warn <<"EOT";
+        my $msg = <<"EOT";
 
 **** Warning: $name requires that the $plugin plugin be installed and
               enabled; it does not appear to be installed.
-
 EOT
+        warn RED, $msg, RESET, "\n";
     }
     $self->requires(@_);
 }
@@ -264,9 +281,8 @@ sub rt_too_new {
     my $name = $self->name;
     $msg ||= <<EOT;
 
-**** Error: Your installed version of RT (%s) is too new; this extension
-            only works with versions older than %s.
-
+**** Warning: Your installed version of RT (%s) is too new; this extension
+              has not been tested on your version of RT and may not work as expected.
 EOT
     $self->add_metadata("x_rt_too_new", $version) if $self->is_admin;
 
@@ -274,7 +290,7 @@ EOT
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[0] eq $version) {
-        die sprintf($msg,$RT::VERSION,$version);
+        warn RED, sprintf($msg,$RT::VERSION), RESET, "\n";
     }
 }
 
@@ -297,4 +313,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 468
+#line 484

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

Summary of changes:
 Changes                               |  3 +++
 META.yml                              |  6 +++---
 Makefile.PL                           |  3 ++-
 README                                | 11 ++++++----
 inc/Module/Install/RTx.pm             | 38 +++++++++++++++++++++++++----------
 lib/RT/Extension/RepliesToResolved.pm | 14 ++++++++-----
 6 files changed, 51 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
RT-Extension-RepliesToResolved


More information about the Bps-public-commit mailing list