[Bps-public-commit] RT-Extension-LDAPImport branch, master, updated. 0.31_03-9-g71b1459

Kevin Falcone falcone at bestpractical.com
Tue Mar 22 14:28:00 EDT 2011


The branch, master has been updated
       via  71b1459bb07b8c6f665e66d8b5e6fb4f6b905092 (commit)
       via  0881f45471fc409281c25a8adad2387907f5d360 (commit)
       via  afd8fa0689ff1866f48b5f97ab0b004da0a67cb2 (commit)
      from  56c45664c441043d7d8725903930cdd18ace5caf (commit)

Summary of changes:
 Changes                        |    6 +++++
 MANIFEST                       |    5 ++-
 META.yml                       |    3 +-
 Makefile.PL                    |    2 +-
 inc/Module/Install/RTx.pm      |   46 ++++++++++++++++++++++++++++++++++++---
 lib/RT/Extension/LDAPImport.pm |    2 +-
 6 files changed, 54 insertions(+), 10 deletions(-)

- Log -----------------------------------------------------------------
commit afd8fa0689ff1866f48b5f97ab0b004da0a67cb2
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Mar 22 13:03:08 2011 -0400

    upgrade to rt4 compat MIRTx

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 873e823..d8ab04c 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.26';
+our $VERSION = '0.28';
 
 use FindBin;
 use File::Glob     ();
@@ -44,8 +44,8 @@ sub RTx {
         local @INC = (
             $ENV{RTHOME} ? ( $ENV{RTHOME}, "$ENV{RTHOME}/lib" ) : (),
             @INC,
-            map { ( "$_/rt3/lib", "$_/lib/rt3", "$_/lib" ) } grep $_,
-            @prefixes
+            map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/rt3/lib", "$_/lib/rt3", "$_/lib" )
+                } grep $_, @prefixes
         );
         until ( eval { require RT; $RT::LocalPath } ) {
             warn

commit 0881f45471fc409281c25a8adad2387907f5d360
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Mar 22 14:26:13 2011 -0400

    convert to using requires_rt

diff --git a/META.yml b/META.yml
index a4f18b3..8e6e2ee 100644
--- a/META.yml
+++ b/META.yml
@@ -24,7 +24,6 @@ requires:
   Class::Accessor: 0
   Net::LDAP: 0
   Net::LDAP::Server::Test: 0
-  RT: 3.6.3
   Test::More: 0
 resources:
   license: http://dev.perl.org/licenses/
diff --git a/Makefile.PL b/Makefile.PL
index e584696..51938c5 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -8,7 +8,7 @@ all_from('lib/RT/Extension/LDAPImport.pm');
 
 requires('Test::More');
 requires('Net::LDAP');
-requires('RT', '3.6.3');
+requires_rt('3.6.3');
 requires('Class::Accessor');
 
 feature "Proper Testing" =>
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index d8ab04c..79ff38e 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -186,8 +186,46 @@ sub RTxInit {
     die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
 }
 
+# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
+{ my %word = (
+    a     => -4,
+    alpha => -4,
+    b     => -3,
+    beta  => -3,
+    pre   => -2,
+    rc    => -1,
+    head  => 9999,
+);
+sub cmp_version($$) {
+    my ($a, $b) = (@_);
+    my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
+        split /([^0-9]+)/, $a;
+    my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
+        split /([^0-9]+)/, $b;
+    @a > @b
+        ? push @b, (0) x (@a- at b)
+        : push @a, (0) x (@b- at a);
+    for ( my $i = 0; $i < @a; $i++ ) {
+        return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
+    }
+    return 0;
+}}
+sub requires_rt {
+    my ($self,$version) = @_;
+
+    # if we're exactly the same version as what we want, silently return
+    return if ($version eq $RT::VERSION);
+
+    my @sorted = sort cmp_version $version,$RT::VERSION;
+
+    if ($sorted[-1] eq $version) {
+        # should we die?
+        warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+    }
+}
+
 1;
 
 __END__
 
-#line 304
+#line 342

commit 71b1459bb07b8c6f665e66d8b5e6fb4f6b905092
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Mar 22 14:27:48 2011 -0400

    bump version and do release engineering for 0.31

diff --git a/Changes b/Changes
index 10a26ee..cc249f3 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,10 @@
 Revision history for RT-Extension-LDAPImport
+0.31
+    Further upgrades to MIRTx for RT4 compat
+    Warn and skip numeric users and groups
+    Add an $LDAPCreatePrivileged flag to create imported users as Privileged
+    Add an optimization for adding new groups; if we just created it, we know it is empty, so skip the member query
+
 0.31_03
     Upgrade Module::Install::RTx so it can find RT.pm
     and version check properly.
diff --git a/MANIFEST b/MANIFEST
index af17b7e..5963997 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -16,13 +16,14 @@ inc/Module/Install/WriteAll.pm
 INSTALL.SKIP
 lib/RT/Extension/LDAPImport.pm
 Makefile.PL
-MANIFEST
+MANIFEST			This list of files
 MANIFEST.SKIP
-META.yml			# Will be created by "make dist"
+META.yml
 README
 t/00.load.t
 t/group-import.t
 t/lib/RT/Extension/LDAPImport/Test.pm.in
 t/pod-coverage.t
 t/pod.t
+t/user-import-privileged.t
 t/user-import.t
diff --git a/META.yml b/META.yml
index 8e6e2ee..4997c17 100644
--- a/META.yml
+++ b/META.yml
@@ -27,4 +27,4 @@ requires:
   Test::More: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.31_03
+version: 0.31
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 79ff38e..b83e279 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -228,4 +228,4 @@ sub requires_rt {
 
 __END__
 
-#line 342
+#line 348
diff --git a/lib/RT/Extension/LDAPImport.pm b/lib/RT/Extension/LDAPImport.pm
index 239753d..c6022d7 100644
--- a/lib/RT/Extension/LDAPImport.pm
+++ b/lib/RT/Extension/LDAPImport.pm
@@ -1,6 +1,6 @@
 package RT::Extension::LDAPImport;
 
-our $VERSION = '0.31_03';
+our $VERSION = '0.31';
 
 use warnings;
 use strict;

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



More information about the Bps-public-commit mailing list