[Rt-commit] rtir branch 4.0-trunk updated. 4.0.2-1-g5f2b66c4

BPS Git Server git at git.bestpractical.com
Tue Sep 14 19:32:24 UTC 2021


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 "rtir".

The branch, 4.0-trunk has been updated
       via  5f2b66c4b86d93615035955f06ebf02b10e4226a (commit)
       via  4f51e448d9833398161f6a6c1c80283ba00b904a (commit)
       via  42fbc6d02ceb37b466ed724a79cd7ccaf9d140ed (commit)
      from  3c051ff7332a2ec38f4391138aacc92b20f3a189 (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 5f2b66c4b86d93615035955f06ebf02b10e4226a
Merge: 3c051ff7 4f51e448
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Sep 15 03:31:49 2021 +0800

    Merge branch '4.0.2-releng' into 4.0-trunk


commit 4f51e448d9833398161f6a6c1c80283ba00b904a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Sep 14 22:00:10 2021 +0800

    Release 4.0.2

diff --git a/META.yml b/META.yml
index df7c63d0..1c13b81d 100644
--- a/META.yml
+++ b/META.yml
@@ -32,7 +32,7 @@ requires:
   perl: 5.10.1
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: 4.0.1
+version: 4.0.2
 x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.4.1
 x_rt_too_new: 4.6.0
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 4a28f0bf..21a98cd2 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -51,7 +51,7 @@ use 5.008003;
 use strict;
 use warnings;
 
-our $VERSION = '4.0.1';
+our $VERSION = '4.0.2';
 
 use Scalar::Util qw(blessed);
 

commit 42fbc6d02ceb37b466ed724a79cd7ccaf9d140ed
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Sep 14 21:58:12 2021 +0800

    Update M:I:RTx to 0.42

diff --git a/META.yml b/META.yml
index 085336e6..df7c63d0 100644
--- a/META.yml
+++ b/META.yml
@@ -33,6 +33,6 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: 4.0.1
-x_module_install_rtx_version: '0.40'
+x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.4.1
 x_rt_too_new: 4.6.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 7cad5299..2dd94897 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.42';
 
 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;
@@ -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:
 META.yml                  |  4 ++--
 inc/Module/Install/RTx.pm | 36 ++++++++++++++++++++++++++----------
 lib/RT/IR.pm              |  2 +-
 3 files changed, 29 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
rtir


More information about the rt-commit mailing list