Commit 0cabe54c authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Upgrade Module::Install::RTx

parent 2e28e98a
......@@ -26,6 +26,6 @@ requires:
resources:
license: http://opensource.org/licenses/gpl-2.0.php
version: '1.00'
x_module_install_rtx_version: 0.34_02
x_module_install_rtx_version: 0.34_03
x_requires_rt: 4.0.0
x_rt_too_new: 4.4.0
......@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base;
use base 'Module::Install::Base';
our $VERSION = '0.34_02';
our $VERSION = '0.34_03';
use FindBin;
use File::Glob ();
......@@ -90,11 +90,11 @@ lexicons ::
.
}
$self->load('RTxPlugin');
$self->include('Module::Install::RTx::Runtime') if $self->admin;
$self->include_deps( 'YAML::Tiny', 0 ) if $self->admin;
my $postamble = << ".";
install ::
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxPlugin()"
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxPlugin()"
\t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
.
......@@ -130,23 +130,22 @@ install ::
$self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
if (%has_etc) {
$self->load('RTxDatabase');
print "For first-time installation, type 'make initdb'.\n";
my $initdb = '';
$initdb .= <<"." if $has_etc{schema};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxDatabase(qw(schema \$(NAME) \$(VERSION)))"
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(schema \$(NAME) \$(VERSION)))"
.
$initdb .= <<"." if $has_etc{acl};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxDatabase(qw(acl \$(NAME) \$(VERSION)))"
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(acl \$(NAME) \$(VERSION)))"
.
$initdb .= <<"." if $has_etc{initialdata};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxDatabase(qw(insert \$(NAME) \$(VERSION)))"
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(insert \$(NAME) \$(VERSION)))"
.
$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"RTxDatabase(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
$self->postamble("upgrade-database ::\n$upgradedb\n");
$self->postamble("upgradedb ::\n$upgradedb\n");
}
......@@ -249,4 +248,4 @@ sub _load_rt_handle {
__END__
#line 368
#line 367
#line 1
package Module::Install::RTx::Runtime;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
use base 'Exporter';
our @EXPORT = qw/RTxDatabase RTxPlugin/;
use strict;
use File::Basename ();
......@@ -22,9 +24,9 @@ EOT
}
sub RTxDatabase {
my ($self, $action, $name, $version) = @_;
my ($action, $name, $version) = @_;
$self->_rt_runtime_load;
_rt_runtime_load();
require RT::System;
my $has_upgrade = RT::System->can('AddUpgradeHistory');
......@@ -54,9 +56,9 @@ sub RTxDatabase {
}
sub RTxPlugin {
my ($self, $name) = @_;
my ($name) = @_;
$self->_rt_runtime_load;
_rt_runtime_load();
require YAML::Tiny;
my $data = YAML::Tiny::LoadFile('META.yml');
my $name = $data->{name};
......
Markdown is supported
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