[Bps-public-commit] Module-Install-RTx branch, master, updated. 0.31-6-gef5ac5e

Kevin Falcone falcone at bestpractical.com
Fri Sep 6 12:09:52 EDT 2013


The branch, master has been updated
       via  ef5ac5e19caff666069a3ce7df7f46beca28ed80 (commit)
       via  4120bba3fccab386e3099abd32f2d8415c3c51e6 (commit)
       via  7bd238f0bd3c69ba5f704c8984ecc55a03a8a57a (commit)
       via  55b082452e0c84d5616ae50cbb6a57b70bde8ee9 (commit)
       via  5020cb6b31d38ee0e757560f025ae31130584607 (commit)
       via  5178e192326fb78b0601082d0a6d9d2e7a115ab5 (commit)
      from  85ba1bada368b380fcb4bc48a792ca95e8592333 (commit)

Summary of changes:
 Changes                           | 5 +++++
 META.yml                          | 4 ++--
 lib/Module/Install/RTx.pm         | 9 ++++++++-
 lib/Module/Install/RTx/Factory.pm | 9 ++++++++-
 4 files changed, 23 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 5178e192326fb78b0601082d0a6d9d2e7a115ab5
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..6e4c113 100644
--- a/lib/Module/Install/RTx/Factory.pm
+++ b/lib/Module/Install/RTx/Factory.pm
@@ -37,6 +37,13 @@ sub RTxInitDB {
         "--prompt-for-dba-password" => '',
         (RT::System->can('AddUpgradeHistory') ? ("--package" => $name, "--ext-version" => $version) : ()),
     );
+    # If we're upgrading against an RT which isn't at least 4.2 (has
+    # AddUpgradeHistory) then pass --package.  Upgrades against later RT
+    # releases will pick up --package from AddUpgradeHistory.
+    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 5020cb6b31d38ee0e757560f025ae31130584607
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 6e4c113..1ad8c8d 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 55b082452e0c84d5616ae50cbb6a57b70bde8ee9
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");
+        }
     }
 }
 

commit 7bd238f0bd3c69ba5f704c8984ecc55a03a8a57a
Merge: 85ba1ba 55b0824
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Sep 4 20:24:16 2013 -0400

    Merge branch 'make-upgrade'


commit 4120bba3fccab386e3099abd32f2d8415c3c51e6
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Sep 4 22:31:09 2013 -0400

    Note what we're merging down for 0.32

diff --git a/Changes b/Changes
index 9ba7841..6c603e8 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,8 @@
+[Changes for 0.32 2013-09-06]
+* new make upgrade-database command
+** this feature needs RT 4.2 or 4.0.14+ for maximum benefit
+** used in the RTIR 3.0 release series
+
 [Changes for 0.31 2013-04-08]
 * Changes targetting newer releases of RT
 ** Use the DatabaseAdmin configuration is supplied

commit ef5ac5e19caff666069a3ce7df7f46beca28ed80
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Sep 6 11:46:47 2013 -0400

    bump version to 0.32

diff --git a/META.yml b/META.yml
index 78d3762..58aeec5 100644
--- a/META.yml
+++ b/META.yml
@@ -21,7 +21,7 @@ no_index:
 provides:
   Module::Install::RTx:
     file: lib/Module/Install/RTx.pm
-    version: 0.31
+    version: 0.32
   Module::Install::RTx::Factory:
     file: lib/Module/Install/RTx/Factory.pm
 requires:
@@ -29,4 +29,4 @@ requires:
   perl: 5.8.0
 resources:
   license: http://opensource.org/licenses/mit-license.php
-version: 0.31
+version: 0.32
diff --git a/lib/Module/Install/RTx.pm b/lib/Module/Install/RTx.pm
index b673df5..ae79a34 100644
--- a/lib/Module/Install/RTx.pm
+++ b/lib/Module/Install/RTx.pm
@@ -7,7 +7,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.31';
+our $VERSION = '0.32';
 
 use FindBin;
 use File::Glob     ();

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



More information about the Bps-public-commit mailing list