[Bps-public-commit] Module-Install-RTx branch, make-upgrade, created. 0.31-3-g2de6ebf
Kevin Falcone
falcone at bestpractical.com
Tue Jun 25 18:17:02 EDT 2013
The branch, make-upgrade has been created
at 2de6ebfee9977351041dfeba6efa2d6470b7b321 (commit)
- Log -----------------------------------------------------------------
commit e01f3ac59b828286bcf8630648b071acda6acec7
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Tue Jun 25 16:30:15 2013 -0400
Use the --package argument to brand upgrade
When running make upgrade-database from an extension, pass in the name
of the extension so that the user is prompted to answer "What RT::IR
version are you upgrading from".
diff --git a/lib/Module/Install/RTx/Factory.pm b/lib/Module/Install/RTx/Factory.pm
index 094a055..01fb4ff 100644
--- a/lib/Module/Install/RTx/Factory.pm
+++ b/lib/Module/Install/RTx/Factory.pm
@@ -37,6 +37,10 @@ sub RTxInitDB {
"--prompt-for-dba-password" => '',
(RT::System->can('AddUpgradeHistory') ? ("--package" => $name, "--ext-version" => $version) : ()),
);
+ if ($action eq 'upgrade' and
+ not RT::System->can('AddUpgradeHistory')) {
+ push @args, "--package" => $name;
+ }
print "$^X @args\n";
(system($^X, @args) == 0) or die "...returned with error: $?\n";
commit b78bfda8a359b01327d7350a2829b31e4d707fcb
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Fri Jun 7 18:43:50 2013 -0400
Don't always hardcode etc/
When running --action upgrade rt-setup-database wants to look in
etc/upgrade and this would prevent that.
diff --git a/lib/Module/Install/RTx/Factory.pm b/lib/Module/Install/RTx/Factory.pm
index 01fb4ff..43c1d55 100644
--- a/lib/Module/Install/RTx/Factory.pm
+++ b/lib/Module/Install/RTx/Factory.pm
@@ -31,7 +31,7 @@ sub RTxInitDB {
"-I$lib_path",
"$RT::SbinPath/rt-setup-database",
"--action" => $action,
- "--datadir" => "etc",
+ ($action eq 'upgrade' ? () : ("--datadir" => "etc")),
(($action eq 'insert') ? ("--datafile" => "etc/initialdata") : ()),
"--dba" => $RT::DatabaseAdmin || $RT::DatabaseUser,
"--prompt-for-dba-password" => '',
commit 2de6ebfee9977351041dfeba6efa2d6470b7b321
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Tue Jun 25 17:33:43 2013 -0400
Ship a make upgrade-database target
If your extension contains an etc/upgrade directory, we'll attempt to
use rt-setup-database's upgrade action.
diff --git a/lib/Module/Install/RTx.pm b/lib/Module/Install/RTx.pm
index f1e3bbe..b673df5 100644
--- a/lib/Module/Install/RTx.pm
+++ b/lib/Module/Install/RTx.pm
@@ -135,6 +135,7 @@ install ::
$has_etc{acl}++;
}
if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
+ if ( -d 'etc/upgrade/' ) { $has_etc{upgrade}++; }
$self->postamble("$postamble\n");
unless ( $subdirs{'lib'} ) {
@@ -163,6 +164,12 @@ install ::
.
$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"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+ $self->postamble("upgrade-database ::\n$upgradedb\n");
+ $self->postamble("upgradedb ::\n$upgradedb\n");
+ }
}
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list