[Bps-public-commit] r11167 - Module-Install-RTx/lib/Module/Install

ruz at bestpractical.com ruz at bestpractical.com
Mon Mar 24 16:30:36 EDT 2008


Author: ruz
Date: Mon Mar 24 16:30:34 2008
New Revision: 11167

Modified:
   Module-Install-RTx/lib/Module/Install/RTx.pm

Log:
* run all utils that may load RT config with local/lib path in @INC

Modified: Module-Install-RTx/lib/Module/Install/RTx.pm
==============================================================================
--- Module-Install-RTx/lib/Module/Install/RTx.pm	(original)
+++ Module-Install-RTx/lib/Module/Install/RTx.pm	Mon Mar 24 16:30:34 2008
@@ -48,6 +48,7 @@
     }
 
     my $lib_path = File::Basename::dirname( $INC{'RT.pm'} );
+    my $local_lib_path = "$RT::LocalPath/lib";
     print "Using RT configuration from $INC{'RT.pm'}:\n";
     unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
 
@@ -63,7 +64,7 @@
 
     foreach (qw(bin etc html po sbin var)) {
         next unless -d "$FindBin::Bin/$_";
-        next if %subdirs and !$subdirs{$_};
+        next if keys %subdirs and !$subdirs{$_};
         $self->no_index( directory => $_ );
 
         no strict 'refs';
@@ -72,7 +73,7 @@
     }
 
     $path{$_} .= "/$name" for grep $path{$_}, qw(etc po var);
-    $path{lib} = "$RT::LocalPath/lib" unless %subdirs and !$subdirs{'lib'};
+    $path{lib} = "$RT::LocalPath/lib" unless keys %subdirs and !$subdirs{'lib'};
 
     # If we're running on RT 3.8 with plugin support, we really wany
     # to install libs, mason templates and po files into plugin specific
@@ -117,10 +118,10 @@
         $self->load('RTxFactory');
         $self->postamble(<< ".");
 factory ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
 
 dropdb ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
 
 .
     }
@@ -145,13 +146,13 @@
         print "For first-time installation, type 'make initdb'.\n";
         my $initdb = '';
         $initdb .= <<"." if $has_etc{schema};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema))"
 .
         $initdb .= <<"." if $has_etc{acl};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
 .
         $initdb .= <<"." if $has_etc{initialdata};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");



More information about the Bps-public-commit mailing list