[Bps-public-commit] rt-extension-tags branch, master, updated. 0.03-10-g5deebd7

? sunnavy sunnavy at bestpractical.com
Fri Jul 17 10:55:30 EDT 2020


The branch, master has been updated
       via  5deebd778ccd0b4db458ae9dc2181430c3ff8c09 (commit)
       via  26d04bd46a675e841995f71bb2c597591027b263 (commit)
       via  73e1161a62b6c3c73579f6a172cedd5664f34ac9 (commit)
       via  99dea4bf03abda3fa7b3f41dd6d85a7e17811302 (commit)
       via  dbbd8662b1fb8392f49085f855cedc9640b51a12 (commit)
      from  38b6f9af305f8c4996971ca4c66c4fe95e312849 (commit)

Summary of changes:
 Changes                   |  5 +++++
 META.yml                  |  6 +++---
 Makefile.PL               |  3 ++-
 README                    |  9 +++++----
 inc/Module/Install/RTx.pm | 36 ++++++++++++++++++++++++++----------
 lib/RT/Extension/Tags.pm  | 10 +++++-----
 6 files changed, 46 insertions(+), 23 deletions(-)

- Log -----------------------------------------------------------------
commit dbbd8662b1fb8392f49085f855cedc9640b51a12
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 17 22:26:38 2020 +0800

    Update M:I

diff --git a/META.yml b/META.yml
index 22eb085..3711a06 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-tags
 version: '0.04'
-x_module_install_rtx_version: '0.40'
+x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.6.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 7cad529..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.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

commit 99dea4bf03abda3fa7b3f41dd6d85a7e17811302
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 17 22:31:07 2020 +0800

    Update for RT 5.0

diff --git a/META.yml b/META.yml
index 3711a06..822d548 100644
--- a/META.yml
+++ b/META.yml
@@ -28,4 +28,4 @@ resources:
 version: '0.04'
 x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.0.0
-x_rt_too_new: 4.6.0
+x_rt_too_new: 5.2.0
diff --git a/Makefile.PL b/Makefile.PL
index 12fb1d6..6f9d489 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,7 +5,7 @@ license 'gplv2';
 repository 'https://github.com/bestpractical/rt-extension-tags';
 
 requires_rt '4.0.0';
-rt_too_new '4.6.0';
+rt_too_new '5.2.0';
 
 sign;
 WriteAll;
diff --git a/README b/README
index c19e3af..25bf386 100644
--- a/README
+++ b/README
@@ -14,7 +14,7 @@ DESCRIPTION
     The initdb step installs an example global Tag custom field.
 
 RT VERSION
-    Works with RT 4.0, 4.2, 4.4
+    Works with RT 4.0, 4.2, 4.4, 5.0
 
 INSTALLATION
     perl Makefile.PL
@@ -22,7 +22,7 @@ INSTALLATION
     make install
         May need root permissions
 
-    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::Tags');
@@ -37,7 +37,7 @@ INSTALLATION
         This optional step installs an example global Tag custom field.
 
     Clear your mason cache
-            rm -rf /opt/rt4/var/mason_data/obj
+            rm -rf /opt/rt5/var/mason_data/obj
 
     Restart your webserver
 
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index 34aac6e..705a798 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -68,7 +68,7 @@ The initdb step installs an example global Tag custom field.
 
 =head1 RT VERSION
 
-Works with RT 4.0, 4.2, 4.4
+Works with RT 4.0, 4.2, 4.4, 5.0
 
 =head1 INSTALLATION
 
@@ -82,7 +82,7 @@ Works with RT 4.0, 4.2, 4.4
 
 May need root permissions
 
-=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:
 
@@ -100,7 +100,7 @@ This optional step installs an example global C<Tag> custom field.
 
 =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
 

commit 73e1161a62b6c3c73579f6a172cedd5664f34ac9
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 17 22:32:08 2020 +0800

    Add "." to @INC for perl 5.26+

diff --git a/Makefile.PL b/Makefile.PL
index 6f9d489..2d3c0a5 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,3 +1,4 @@
+use lib '.';
 use inc::Module::Install;
 
 RTx     'RT-Extension-Tags';

commit 26d04bd46a675e841995f71bb2c597591027b263
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 17 22:32:44 2020 +0800

    Update copyright year to 2020

diff --git a/README b/README
index 25bf386..12e0958 100644
--- a/README
+++ b/README
@@ -70,7 +70,8 @@ BUGS
         L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-Tags>.
 
 LICENSE AND COPYRIGHT
-    This software is Copyright (c) 2016 by Best Practical Solutions, LLC
+    This software is Copyright (c) 2016-2020 by Best Practical Solutions,
+    LLC
 
     This is free software, licensed under:
 
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index 705a798..78d7d8c 100644
--- a/lib/RT/Extension/Tags.pm
+++ b/lib/RT/Extension/Tags.pm
@@ -143,7 +143,7 @@ or via the web at
 
 =head1 LICENSE AND COPYRIGHT
 
-This software is Copyright (c) 2016 by Best Practical Solutions, LLC
+This software is Copyright (c) 2016-2020 by Best Practical Solutions, LLC
 
 This is free software, licensed under:
 

commit 5deebd778ccd0b4db458ae9dc2181430c3ff8c09
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jul 17 22:34:04 2020 +0800

    Prep 0.05

diff --git a/Changes b/Changes
index 0a932f6..8db8d3e 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Revision history for RT-Extension-Tags
 
+0.05 2020-07-17
+
+ - Put "make initdb" after enabling the plugin in doc
+ - Make it work with RT 5.0
+
 0.04 2017-02-20
 
  - Update tag input elements to be consistent with usage in RT 4.2, 4.4
diff --git a/META.yml b/META.yml
index 822d548..1b437cc 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.04'
+version: '0.05'
 x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.0.0
 x_rt_too_new: 5.2.0
diff --git a/lib/RT/Extension/Tags.pm b/lib/RT/Extension/Tags.pm
index 78d7d8c..7c631ef 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.04';
+our $VERSION = '0.05';
 
 
 require RT::CustomField;

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


More information about the Bps-public-commit mailing list