Commit 787bc18e authored by Thomas Sibley's avatar Thomas Sibley
Browse files

Update M::I

parent 22b0995c
...@@ -8,7 +8,7 @@ no warnings 'once'; ...@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base; use Module::Install::Base;
use base 'Module::Install::Base'; use base 'Module::Install::Base';
our $VERSION = '0.29'; our $VERSION = '0.29_02';
use FindBin; use FindBin;
use File::Glob (); use File::Glob ();
...@@ -129,18 +129,7 @@ install :: ...@@ -129,18 +129,7 @@ install ::
my %has_etc; my %has_etc;
if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) { if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) {
# got schema, load factory module
$has_etc{schema}++; $has_etc{schema}++;
$self->load('RTxFactory');
$self->postamble(<< ".");
factory ::
\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"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
.
} }
if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) { if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) {
$has_etc{acl}++; $has_etc{acl}++;
...@@ -164,28 +153,19 @@ dropdb :: ...@@ -164,28 +153,19 @@ dropdb ::
print "For first-time installation, type 'make initdb'.\n"; print "For first-time installation, type 'make initdb'.\n";
my $initdb = ''; my $initdb = '';
$initdb .= <<"." if $has_etc{schema}; $initdb .= <<"." if $has_etc{schema};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -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 \$(NAME) \$(VERSION)))"
. .
$initdb .= <<"." if $has_etc{acl}; $initdb .= <<"." if $has_etc{acl};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -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 \$(NAME) \$(VERSION)))"
. .
$initdb .= <<"." if $has_etc{initialdata}; $initdb .= <<"." if $has_etc{initialdata};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -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 \$(NAME) \$(VERSION)))"
. .
$self->postamble("initdb ::\n$initdb\n"); $self->postamble("initdb ::\n$initdb\n");
$self->postamble("initialize-database ::\n$initdb\n"); $self->postamble("initialize-database ::\n$initdb\n");
} }
} }
sub RTxInit {
unshift @INC, substr( delete( $INC{'RT.pm'} ), 0, -5 ) if $INC{'RT.pm'};
require RT;
RT::LoadConfig();
RT::ConnectToDatabase();
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) # stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
{ my %word = ( { my %word = (
a => -4, a => -4,
...@@ -228,4 +208,4 @@ sub requires_rt { ...@@ -228,4 +208,4 @@ sub requires_rt {
__END__ __END__
#line 348 #line 328
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment