[Bps-public-commit] RT-Extension-SLA branch, master, updated. 1.02

Alex Vandiver alexmv at bestpractical.com
Tue Dec 2 11:25:05 EST 2014


The branch, master has been updated
       via  6b503018d28124e6b8fe1dcb3267940430c27b27 (commit)
       via  f25c87bdb6f3b0ad5de75b098ffbdf9f1eb6c098 (commit)
       via  d802cf92aae299d751ad70ae1a4a01935266e449 (commit)
      from  3e0d9b973c61a29de873c76366e58639747083bb (commit)

Summary of changes:
 Changes                           |  4 ++++
 META.yml                          |  6 +++---
 inc/Module/AutoInstall.pm         | 42 +++++++++++++++++++++------------------
 inc/Module/Install.pm             | 18 ++++++++---------
 inc/Module/Install/AutoInstall.pm |  2 +-
 inc/Module/Install/Base.pm        |  2 +-
 inc/Module/Install/Can.pm         |  2 +-
 inc/Module/Install/Fetch.pm       |  2 +-
 inc/Module/Install/Include.pm     |  2 +-
 inc/Module/Install/Makefile.pm    |  4 ++--
 inc/Module/Install/Metadata.pm    |  6 +++---
 inc/Module/Install/RTx.pm         | 32 ++++++++++++++++++-----------
 inc/Module/Install/Win32.pm       |  2 +-
 inc/Module/Install/WriteAll.pm    |  2 +-
 lib/RT/Condition/SLA.pm           |  2 +-
 lib/RT/Extension/SLA.pm           |  2 +-
 16 files changed, 73 insertions(+), 57 deletions(-)

- Log -----------------------------------------------------------------
commit d802cf92aae299d751ad70ae1a4a01935266e449
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Dec 2 11:20:28 2014 -0500

    Reduce severity of "no SLA customfield"; it is not an error
    
    There is nothing wrong with choosing to not have the SLA CF applied to
    all queues; stop logging at the "error" level in such cases.  The
    logging is still potentially useful for debugging -- reduce the level to
    "debug", rather than entirely removing it.

diff --git a/lib/RT/Condition/SLA.pm b/lib/RT/Condition/SLA.pm
index cada30b..2e75aac 100644
--- a/lib/RT/Condition/SLA.pm
+++ b/lib/RT/Condition/SLA.pm
@@ -25,7 +25,7 @@ sub IsCustomFieldChange {
 
     my $cf = $self->GetCustomField( CustomField => $cf_name );
     unless ( $cf->id ) {
-        $RT::Logger->error("Custom field '$cf_name' is not applied to ticket #". $self->TicketObj->id);
+        $RT::Logger->debug("Custom field '$cf_name' is not applied to ticket #". $self->TicketObj->id);
         return 0;
     }
     return 0 unless $cf->id == $txn->Field;

commit f25c87bdb6f3b0ad5de75b098ffbdf9f1eb6c098
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Dec 2 11:22:57 2014 -0500

    Update Module::Install and Module::Install::RTx

diff --git a/META.yml b/META.yml
index d5fb69f..ab714c6 100644
--- a/META.yml
+++ b/META.yml
@@ -9,7 +9,7 @@ configure_requires:
   ExtUtils::MakeMaker: 6.59
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.08'
+generated_by: 'Module::Install version 1.12'
 license: gpl2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -27,6 +27,6 @@ resources:
   license: http://opensource.org/licenses/gpl-2.0.php
   repository: https://github.com/bestpractical/rt-extension-sla
 version: '1.01'
-x_module_install_rtx_version: 0.34_04
+x_module_install_rtx_version: '0.36'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.4.0
diff --git a/inc/Module/AutoInstall.pm b/inc/Module/AutoInstall.pm
index f115790..4aca606 100644
--- a/inc/Module/AutoInstall.pm
+++ b/inc/Module/AutoInstall.pm
@@ -8,7 +8,7 @@ use ExtUtils::MakeMaker ();
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 }
 
 # special map on pre-defined feature sets
@@ -115,7 +115,7 @@ sub import {
     print "*** $class version " . $class->VERSION . "\n";
     print "*** Checking for Perl dependencies...\n";
 
-    my $cwd = Cwd::cwd();
+    my $cwd = Cwd::getcwd();
 
     $Config = [];
 
@@ -166,7 +166,7 @@ sub import {
         $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
 
         unshift @$modules, -default => &{ shift(@$modules) }
-          if ( ref( $modules->[0] ) eq 'CODE' );    # XXX: bugward combatability
+          if ( ref( $modules->[0] ) eq 'CODE' );    # XXX: bugward compatibility
 
         while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
             if ( $mod =~ m/^-(\w+)$/ ) {
@@ -345,22 +345,26 @@ sub install {
     my $i;    # used below to strip leading '-' from config keys
     my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } );
 
-    my ( @modules, @installed );
-    while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) {
+	my ( @modules, @installed, @modules_to_upgrade );
+	while (my ($pkg, $ver) = splice(@_, 0, 2)) {
 
-        # grep out those already installed
-        if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) {
-            push @installed, $pkg;
-        }
-        else {
-            push @modules, $pkg, $ver;
-        }
-    }
+		# grep out those already installed
+		if (_version_cmp(_version_of($pkg), $ver) >= 0) {
+			push @installed, $pkg;
+			if ($UpgradeDeps) {
+				push @modules_to_upgrade, $pkg, $ver;
+			}
+		}
+		else {
+			push @modules, $pkg, $ver;
+		}
+	}
 
-    if ($UpgradeDeps) {
-        push @modules, @installed;
-        @installed = ();
-    }
+	if ($UpgradeDeps) {
+		push @modules, @modules_to_upgrade;
+		@installed          = ();
+		@modules_to_upgrade = ();
+	}
 
     return @installed unless @modules;  # nothing to do
     return @installed if _check_lock(); # defer to the CPAN shell
@@ -611,7 +615,7 @@ sub _under_cpan {
     require Cwd;
     require File::Spec;
 
-    my $cwd  = File::Spec->canonpath( Cwd::cwd() );
+    my $cwd  = File::Spec->canonpath( Cwd::getcwd() );
     my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} );
 
     return ( index( $cwd, $cpan ) > -1 );
@@ -927,4 +931,4 @@ END_MAKE
 
 __END__
 
-#line 1193
+#line 1197
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 7680c84..5460dd5 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -17,7 +17,7 @@ package Module::Install;
 #     3. The ./inc/ version of Module::Install loads
 # }
 
-use 5.005;
+use 5.006;
 use strict 'vars';
 use Cwd        ();
 use File::Find ();
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -156,10 +156,10 @@ END_DIE
 sub autoload {
 	my $self = shift;
 	my $who  = $self->_caller;
-	my $cwd  = Cwd::cwd();
+	my $cwd  = Cwd::getcwd();
 	my $sym  = "${who}::AUTOLOAD";
 	$sym->{$cwd} = sub {
-		my $pwd = Cwd::cwd();
+		my $pwd = Cwd::getcwd();
 		if ( my $code = $sym->{$pwd} ) {
 			# Delegate back to parent dirs
 			goto &$code unless $cwd eq $pwd;
@@ -239,7 +239,7 @@ sub new {
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);
-	unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
+	unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
 		delete $args{prefix};
 	}
 	return $args{_self} if $args{_self};
@@ -338,7 +338,7 @@ sub find_extensions {
 		if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
 			my $content = Module::Install::_read($subpath . '.pm');
 			my $in_pod  = 0;
-			foreach ( split //, $content ) {
+			foreach ( split /\n/, $content ) {
 				$in_pod = 1 if /^=\w/;
 				$in_pod = 0 if /^=cut/;
 				next if ($in_pod || /^=cut/);  # skip pod text
@@ -434,7 +434,7 @@ END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
-sub _version ($) {
+sub _version {
 	my $s = shift || 0;
 	my $d =()= $s =~ /(\.)/g;
 	if ( $d >= 2 ) {
@@ -450,12 +450,12 @@ sub _version ($) {
 	return $l + 0;
 }
 
-sub _cmp ($$) {
+sub _cmp {
 	_version($_[1]) <=> _version($_[2]);
 }
 
 # Cloned from Params::Util::_CLASS
-sub _CLASS ($) {
+sub _CLASS {
 	(
 		defined $_[0]
 		and
diff --git a/inc/Module/Install/AutoInstall.pm b/inc/Module/Install/AutoInstall.pm
index 9d55c20..ab1e5fa 100644
--- a/inc/Module/Install/AutoInstall.pm
+++ b/inc/Module/Install/AutoInstall.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 3e63345..f9bf5de 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 93f248d..b4e5e3b 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index ecc0d53..54f14fb 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index fc86e23..7224cff 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index c0978a4..81cddd5 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -133,7 +133,7 @@ sub makemaker_args {
 	return $args;
 }
 
-# For mm args that take multiple space-seperated args,
+# For mm args that take multiple space-separated args,
 # append an argument to the current list.
 sub makemaker_append {
 	my $self = shift;
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index e4112f8..2c66b1e 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -347,7 +347,7 @@ sub name_from {
 		^ \s*
 		package \s*
 		([\w:]+)
-		\s* ;
+		[\s|;]*
 		/ixms
 	) {
 		my ($name, $module_name) = ($1, $1);
@@ -705,7 +705,7 @@ sub _write_mymeta_data {
 	my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
 	my $meta = $yaml[0];
 
-	# Overwrite the non-configure dependency hashs
+	# Overwrite the non-configure dependency hashes
 	delete $meta->{requires};
 	delete $meta->{build_requires};
 	delete $meta->{recommends};
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 31db76d..73e7245 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.34_04';
+our $VERSION = '0.36';
 
 use FindBin;
 use File::Glob     ();
@@ -18,7 +18,8 @@ my @DIRS = qw(etc lib html static bin sbin po var);
 my @INDEX_DIRS = qw(lib bin sbin);
 
 sub RTx {
-    my ( $self, $name ) = @_;
+    my ( $self, $name, $extra_args ) = @_;
+    $extra_args ||= {};
 
     # Set up names
     my $fname = $name;
@@ -30,12 +31,16 @@ sub RTx {
         unless $self->version;
     $self->abstract("$name Extension")
         unless $self->abstract;
-    $self->readme_from( "lib/$fname.pm",
-                        { options => [ quotes => "none" ] } );
+    unless ( $extra_args->{no_readme_generation} ) {
+        $self->readme_from( "lib/$fname.pm",
+                            { options => [ quotes => "none" ] } );
+    }
     $self->add_metadata("x_module_install_rtx_version", $VERSION );
 
     # Try to find RT.pm
-    my @prefixes = qw( /opt /usr/local /home /usr /sw );
+    my @prefixes = qw( /opt /usr/local /home /usr /sw /usr/share/request-tracker4);
+    $ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME};
+    $ENV{RTHOME} =~ s{/lib/?$}{}  if defined $ENV{RTHOME};
     my @try = $ENV{RTHOME} ? ($ENV{RTHOME}, "$ENV{RTHOME}/lib") : ();
     while (1) {
         my @look = @INC;
@@ -46,9 +51,10 @@ sub RTx {
 
         warn
             "Cannot find the location of RT.pm that defines \$RT::LocalPath in: @look\n";
-        $_ = $self->prompt("Path to directory containing your RT.pm:") or exit;
-        $_ =~ s{(/lib)?/RT\.pm$}{};
-        @try = ("$_/rt4/lib", "$_/lib/rt4", "$_/lib");
+        my $given = $self->prompt("Path to directory containing your RT.pm:") or exit;
+        $given =~ s{/RT\.pm$}{};
+        $given =~ s{/lib/?$}{};
+        @try = ($given, "$given/lib");
     }
 
     print "Using RT configuration from $INC{'RT.pm'}:\n";
@@ -59,7 +65,9 @@ sub RTx {
     unshift @INC, $lib_path;
 
     # Set a baseline minimum version
-    $self->requires_rt('4.0.0');
+    unless ( $extra_args->{deprecated_rt} ) {
+        $self->requires_rt('4.0.0');
+    }
 
     # Installation locations
     my %path;
@@ -115,7 +123,7 @@ install ::
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
-    if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
+    if ( grep { /\d+\.\d+(\.\d+)?.*$/ } glob('etc/upgrade/*.*') ) {
         $has_etc{upgrade}++;
     }
 
@@ -190,7 +198,7 @@ sub requires_rt_plugin {
     my ( $plugin ) = @_;
 
     if ($self->is_admin) {
-        my $plugins = $self->{values}{"x_requires_rt_plugins"} || [];
+        my $plugins = $self->Meta->{values}{"x_requires_rt_plugins"} || [];
         push @{$plugins}, $plugin;
         $self->add_metadata("x_requires_rt_plugins", $plugins);
     }
@@ -250,4 +258,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 369
+#line 390
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index e529382..e48c32d 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 2c74308..409ef40 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.08';
+	$VERSION = '1.12';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

commit 6b503018d28124e6b8fe1dcb3267940430c27b27
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Dec 2 11:24:26 2014 -0500

    Version 1.02 releng

diff --git a/Changes b/Changes
index 7a81fbc..ff9a956 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+1.02 2014-12-02
+ - Reduce severity of "no SLA CF applied to this ticket" logging to
+   debug, as it is a valid configuration.
+
 1.01 2014-07-01
  - Documentation and packaging updates; no code changes
 
diff --git a/META.yml b/META.yml
index ab714c6..2f9f65e 100644
--- a/META.yml
+++ b/META.yml
@@ -26,7 +26,7 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-2.0.php
   repository: https://github.com/bestpractical/rt-extension-sla
-version: '1.01'
+version: '1.02'
 x_module_install_rtx_version: '0.36'
 x_requires_rt: 4.0.0
 x_rt_too_new: 4.4.0
diff --git a/lib/RT/Extension/SLA.pm b/lib/RT/Extension/SLA.pm
index 00d564f..3354202 100644
--- a/lib/RT/Extension/SLA.pm
+++ b/lib/RT/Extension/SLA.pm
@@ -4,7 +4,7 @@ use warnings;
 
 package RT::Extension::SLA;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 
 =head1 NAME
 

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


More information about the Bps-public-commit mailing list