[Bps-public-commit] rt-extension-repeatticket branch, rt5, updated. 1.11-7-gff2bcd2

? sunnavy sunnavy at bestpractical.com
Wed Jul 15 14:26:06 EDT 2020


The branch, rt5 has been updated
       via  ff2bcd258ea7eaab2ea0fe7a9494837f089c1f7a (commit)
      from  c69582bb59e39c7130b30d0f7dc6391cf2f0e17d (commit)

Summary of changes:
 META.yml                  |  2 +-
 inc/Module/Install/RTx.pm | 34 +++++++++++++++++++++++++---------
 2 files changed, 26 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit ff2bcd258ea7eaab2ea0fe7a9494837f089c1f7a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jul 16 02:25:30 2020 +0800

    Update M:I:RTx to 0.42

diff --git a/META.yml b/META.yml
index d958f4a..4063c6c 100644
--- a/META.yml
+++ b/META.yml
@@ -28,5 +28,5 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: '2.0'
-x_module_install_rtx_version: '0.41'
+x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.6.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index d371af9..2dd9489 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.41';
+our $VERSION = '0.42';
 
 use FindBin;
 use File::Glob     ();
@@ -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;
@@ -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

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


More information about the Bps-public-commit mailing list