[Bps-public-commit] RT-Extension-ExtractCustomFieldValues branch, master, updated. 3.09-4-gf3bad70

Alex Vandiver alexmv at bestpractical.com
Thu Oct 3 14:03:37 EDT 2013


The branch, master has been updated
       via  f3bad7084e1cdd0421e30b0163c117029a7d712a (commit)
       via  424a6cb33826c12f671288f2cab38a0dbd4fa53d (commit)
      from  f54058893e228deaa879319e737cf7bf6deb2e83 (commit)

Summary of changes:
 Changes                                      |   4 +
 META.yml                                     |   2 +-
 README                                       | 108 +++++++++++++++++----------
 inc/Module/Install/RTx.pm                    |  11 ++-
 inc/Module/Install/RTx/Factory.pm            |   9 ++-
 inc/Module/Install/ReadmeFromPod.pm          |   2 +-
 lib/RT/Extension/ExtractCustomFieldValues.pm | 107 +++++++++++++++++---------
 7 files changed, 162 insertions(+), 81 deletions(-)

- Log -----------------------------------------------------------------
commit 424a6cb33826c12f671288f2cab38a0dbd4fa53d
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Oct 3 14:02:17 2013 -0400

    Update POD

diff --git a/lib/RT/Extension/ExtractCustomFieldValues.pm b/lib/RT/Extension/ExtractCustomFieldValues.pm
index 4cd2df1..99718dc 100644
--- a/lib/RT/Extension/ExtractCustomFieldValues.pm
+++ b/lib/RT/Extension/ExtractCustomFieldValues.pm
@@ -15,25 +15,43 @@ our $VERSION = '3.09';
 
 =head1 DESCRIPTION
 
-ExtractCustomFieldValues is based on a scrip action
-"ExtractCustomFieldValues", which can be used to scan incoming emails
-to set values of custom fields.
+ExtractCustomFieldValues provides an "ExtractCustomFieldValues" scrip
+action, which can be used to scan incoming emails to set values of
+custom fields.
 
 =head1 INSTALLATION
 
-    perl Makefile.PL
-    make
-    make install
-    make initdb # first time only, not on upgrades
+=over
 
-When using this extension with RT 3.8, you will need to add
-extension to the Plugins configuration:
+=item C<perl Makefile.PL>
 
-    Set( @Plugins, qw(... RT::Extension::ExtractCustomFieldValues) );
+=item C<make>
 
-If you are upgrading this extension from 3.05 or earlier, you will
-need to read the UPGRADING file after running make install to add 
-the new Scrip Action.
+=item C<make install>
+
+May need root permissions
+
+=item C<make initdb>
+
+Only run this the first time you install this module.
+
+If you run this twice, you may end up with duplicate data
+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>
+
+Add this line:
+
+    Set(@Plugins, qw(RT::Extension::ExtractCustomFieldValues));
+
+or add C<RT::Extension::ExtractCustomFieldValues> to your existing C<@Plugins> line.
+
+=item Restart your webserver
+
+=back
 
 =head1 USAGE
 
@@ -48,34 +66,50 @@ where:
 
 =over 4
 
-=item <cf-name> - the name of a custom field (must be created in RT) If this
-field is blank, the match will be run and Postcmd will be executed, but no
-custom field will be updated. Use this if you need to execute other RT code
+=item I<cf-name>
+
+The name of a custom field (must be created in RT).  If this field is
+blank, the match will be run and Postcmd will be executed, but no custom
+field will be updated. Use this if you need to execute other RT code
 based on your match.
 
-=item <Headername> - either a Name of an email header, "body" to scan the body
+=item I<Headername>
+
+Either a Name of an email header, "body" to scan the body
 of the email or "headers" to search all of the headers.
 
-=item <MatchString> - a regular expression to find a match in the header or
-body.  If the MatchString matches a comma separated list and the CF is a
-multi-value CF then each item in the list is added as a separate value.
+=item I<MatchString>
+
+A regular expression to find a match in the header or body.  If the
+MatchString matches a comma separated list and the CF is a multi-value
+CF then each item in the list is added as a separate value.
 
-=item <Postcmd>  - a perl code to be evaluated on C<$value>, where C<$value> is
-either $1 or full match text from the match performed with <MatchString>
+=item I<Postcmd>
 
-=item <Options> - a string of letters which may control some aspects.  Possible
-options include:
+Perl code to be evaluated on C<$value>, where C<$value> is either $1 or
+full match text from the match performed with <MatchString>
+
+=item I<Options>
+
+A string of letters which may control some aspects.  Possible options
+include:
 
 =over 4
 
-=item 'q' - (quiet) Don't record a transaction when adding the custom field value
+=item I<q> - (quiet)
+
+Don't record a transaction when adding the custom field value
+
+=item I<*> - (wildcard)
+
+The MatchString regex should contain _two_ capturing groups, the first
+of which is the CF name, the second of which is the value.  If this
+option is given, the <cf-name> field is ignored.  (Supercedes '+'.)
 
-=item '*' - (wildcard) The MatchString regex should contain _two_ capturing
-groups, the first of which is the CF name, the second of which is the value.
-If this option is given, the <cf-name> field is ignored.  (Supercedes '+'.)
+=item I<+> - (multiple)
 
-=item '+' - (multiple) The MatchString regex will be applied with the /g option
-and all matching values will be added to the CF, which should probably be a
+The MatchString regex will be applied with the /g option and all
+matching values will be added to the CF, which should probably be a
 multi-value CF for best results.  (Superceded by '*'.)
 
 =back
@@ -95,9 +129,8 @@ one of the patterns in the controlling lines.
 =head2 Example and further reading
 
 An example template with some further examples is installed during
-"make install" or "make insert-template". See the
-CustomFieldScannerExample template for examples and further
-documentation.
+C<make initdb>. See the CustomFieldScannerExample template for examples
+and further documentation.
 
 =head1 AUTHOR
 
@@ -109,8 +142,10 @@ and maintained by Best Practical Solutions.
 
 =head1 BUGS
 
-Report bugs using L<http://rt.cpan.org> service, discuss on RT's
-mailing lists, see also L</SUPPORT>
+All bugs should be reported via email to
+L<bug-RT-Extension-ExtractCustomFieldValues at rt.cpan.org|mailto:bug-RT-Extension-ExtractCustomFieldValues at rt.cpan.org>
+or via the web at
+L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-ExtractCustomFieldValues>.
 
 =head1 SUPPORT
 

commit f3bad7084e1cdd0421e30b0163c117029a7d712a
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Oct 3 14:02:56 2013 -0400

    Releng 3.10

diff --git a/Changes b/Changes
index 2cb9209..91550fc 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+3.10    Thu Oct  3 13:48:17 EDT 2013
+* Fix example template to pass the template compiler check
+* Strip leading and trailing spaces when parsing template lines
+
 3.09    Tue Jul 30 20:04:08 PDT 2013
 * Re-release 3.08 aftering fixing PAUSE permissions
 
diff --git a/META.yml b/META.yml
index 0728ef2..adf6c28 100644
--- a/META.yml
+++ b/META.yml
@@ -20,4 +20,4 @@ no_index:
     - inc
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: 3.09
+version: 3.10
diff --git a/README b/README
index b68b3be..d4dbf04 100644
--- a/README
+++ b/README
@@ -3,24 +3,34 @@ NAME
     headers or body
 
 DESCRIPTION
-    ExtractCustomFieldValues is based on a scrip action
-    "ExtractCustomFieldValues", which can be used to scan incoming emails to
-    set values of custom fields.
+    ExtractCustomFieldValues provides an "ExtractCustomFieldValues" scrip
+    action, which can be used to scan incoming emails to set values of
+    custom fields.
 
 INSTALLATION
-        perl Makefile.PL
-        make
-        make install
-        make initdb # first time only, not on upgrades
+    "perl Makefile.PL"
+    "make"
+    "make install"
+        May need root permissions
 
-    When using this extension with RT 3.8, you will need to add extension to
-    the Plugins configuration:
+    "make initdb"
+        Only run this the first time you install this module.
 
-        Set( @Plugins, qw(... RT::Extension::ExtractCustomFieldValues) );
+        If you run this twice, you may end up with duplicate data in your
+        database.
 
-    If you are upgrading this extension from 3.05 or earlier, you will need
-    to read the UPGRADING file after running make install to add the new
-    Scrip Action.
+        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
+        Add this line:
+
+            Set(@Plugins, qw(RT::Extension::ExtractCustomFieldValues));
+
+        or add "RT::Extension::ExtractCustomFieldValues" to your existing
+        @Plugins line.
+
+    Restart your webserver
 
 USAGE
     To use the ScripAction, create a Template and a Scrip in RT. Your new
@@ -32,29 +42,43 @@ USAGE
 
     where:
 
-    <cf-name> - the name of a custom field (must be created in RT) If this
-    field is blank, the match will be run and Postcmd will be executed, but
-    no custom field will be updated. Use this if you need to execute other
-    RT code based on your match.
-    <Headername> - either a Name of an email header, "body" to scan the body
-    of the email or "headers" to search all of the headers.
-    <MatchString> - a regular expression to find a match in the header or
-    body. If the MatchString matches a comma separated list and the CF is a
-    multi-value CF then each item in the list is added as a separate value.
-    <Postcmd> - a perl code to be evaluated on $value, where $value is
-    either $1 or full match text from the match performed with <MatchString>
-    <Options> - a string of letters which may control some aspects. Possible
-    options include:
-
-        'q' - (quiet) Don't record a transaction when adding the custom
-        field value
-        '*' - (wildcard) The MatchString regex should contain _two_
-        capturing groups, the first of which is the CF name, the second of
-        which is the value. If this option is given, the <cf-name> field is
-        ignored. (Supercedes '+'.)
-        '+' - (multiple) The MatchString regex will be applied with the /g
-        option and all matching values will be added to the CF, which should
-        probably be a multi-value CF for best results. (Superceded by '*'.)
+    *cf-name*
+        The name of a custom field (must be created in RT). If this field is
+        blank, the match will be run and Postcmd will be executed, but no
+        custom field will be updated. Use this if you need to execute other
+        RT code based on your match.
+
+    *Headername*
+        Either a Name of an email header, "body" to scan the body of the
+        email or "headers" to search all of the headers.
+
+    *MatchString*
+        A regular expression to find a match in the header or body. If the
+        MatchString matches a comma separated list and the CF is a
+        multi-value CF then each item in the list is added as a separate
+        value.
+
+    *Postcmd*
+        Perl code to be evaluated on $value, where $value is either $1 or
+        full match text from the match performed with <MatchString>
+
+    *Options*
+        A string of letters which may control some aspects. Possible options
+        include:
+
+        *q* - (quiet)
+            Don't record a transaction when adding the custom field value
+
+        *** - (wildcard)
+            The MatchString regex should contain _two_ capturing groups, the
+            first of which is the CF name, the second of which is the value.
+            If this option is given, the <cf-name> field is ignored.
+            (Supercedes '+'.)
+
+        *+* - (multiple)
+            The MatchString regex will be applied with the /g option and all
+            matching values will be added to the CF, which should probably
+            be a multi-value CF for best results. (Superceded by '*'.)
 
   Separator
     You can change the separator string (initially "\|") during the template
@@ -67,8 +91,8 @@ USAGE
 
   Example and further reading
     An example template with some further examples is installed during "make
-    install" or "make insert-template". See the CustomFieldScannerExample
-    template for examples and further documentation.
+    initdb". See the CustomFieldScannerExample template for examples and
+    further documentation.
 
 AUTHOR
     This extension was originally written by Dirk Pape
@@ -78,8 +102,12 @@ AUTHOR
     maintained by Best Practical Solutions.
 
 BUGS
-    Report bugs using <http://rt.cpan.org> service, discuss on RT's mailing
-    lists, see also "SUPPORT"
+    All bugs should be reported via email to
+    bug-RT-Extension-ExtractCustomFieldValues at rt.cpan.org
+    <mailto:bug-RT-Extension-ExtractCustomFieldValues at rt.cpan.org> or via
+    the web at rt.cpan.org
+    <http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-ExtractCu
+    stomFieldValues>.
 
 SUPPORT
     Support requests should be referred to Best Practical
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index c9fe996..ac04c79 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.31';
+our $VERSION = '0.32';
 
 use FindBin;
 use File::Glob     ();
@@ -136,6 +136,7 @@ install ::
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
+    if ( -d 'etc/upgrade/' )    { $has_etc{upgrade}++; }
 
     $self->postamble("$postamble\n");
     unless ( $subdirs{'lib'} ) {
@@ -164,6 +165,12 @@ install ::
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
+        if ($has_etc{upgrade}) {
+            print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n";
+            my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+            $self->postamble("upgrade-database ::\n$upgradedb\n");
+            $self->postamble("upgradedb ::\n$upgradedb\n");
+        }
     }
 }
 
@@ -209,4 +216,4 @@ sub requires_rt {
 
 __END__
 
-#line 329
+#line 336
diff --git a/inc/Module/Install/RTx/Factory.pm b/inc/Module/Install/RTx/Factory.pm
index 76ab761..6776688 100644
--- a/inc/Module/Install/RTx/Factory.pm
+++ b/inc/Module/Install/RTx/Factory.pm
@@ -32,12 +32,19 @@ sub RTxInitDB {
         "-I$lib_path",
         "$RT::SbinPath/rt-setup-database",
         "--action"      => $action,
-        "--datadir"     => "etc",
+        ($action eq 'upgrade' ? () : ("--datadir"     => "etc")),
         (($action eq 'insert') ? ("--datafile"    => "etc/initialdata") : ()),
         "--dba"         => $RT::DatabaseAdmin || $RT::DatabaseUser,
         "--prompt-for-dba-password" => '',
         (RT::System->can('AddUpgradeHistory') ? ("--package" => $name, "--ext-version" => $version) : ()),
     );
+    # If we're upgrading against an RT which isn't at least 4.2 (has
+    # AddUpgradeHistory) then pass --package.  Upgrades against later RT
+    # releases will pick up --package from AddUpgradeHistory.
+    if ($action eq 'upgrade' and
+        not RT::System->can('AddUpgradeHistory')) {
+        push @args, "--package" => $name;
+    }
 
     print "$^X @args\n";
     (system($^X, @args) == 0) or die "...returned with error: $?\n";
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 6a80818..b5e03c3 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.20';
+$VERSION = '0.22';
 
 sub readme_from {
   my $self = shift;
diff --git a/lib/RT/Extension/ExtractCustomFieldValues.pm b/lib/RT/Extension/ExtractCustomFieldValues.pm
index 99718dc..27d17f2 100644
--- a/lib/RT/Extension/ExtractCustomFieldValues.pm
+++ b/lib/RT/Extension/ExtractCustomFieldValues.pm
@@ -9,7 +9,7 @@ RT::Extension::ExtractCustomFieldValues - extract CF values from email headers o
 
 =cut
 
-our $VERSION = '3.09';
+our $VERSION = '3.10';
 
 1;
 

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



More information about the Bps-public-commit mailing list