[Bps-public-commit] Module-Install-RTx branch, upgrade-history, created. 0.29-1-g94dc971

Jim Brandt jbrandt at bestpractical.com
Thu Jul 26 15:18:04 EDT 2012


The branch, upgrade-history has been created
        at  94dc971d77d35513b80340bd6c488bb42445c712 (commit)

- Log -----------------------------------------------------------------
commit 94dc971d77d35513b80340bd6c488bb42445c712
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Jul 26 14:47:29 2012 -0400

    Add name and version parameters to rt-setup-database commands
    
    Add name and version parameters in the Makefile, and pass these
    values through to the rt-setup-database call to track upgrade
    history in the RT DB.
    
    These changes require RT >= 4.2

diff --git a/lib/Module/Install/RTx.pm b/lib/Module/Install/RTx.pm
index 959175b..fff6d5f 100644
--- a/lib/Module/Install/RTx.pm
+++ b/lib/Module/Install/RTx.pm
@@ -163,13 +163,13 @@ dropdb ::
         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"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};
-\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};
-\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("initialize-database ::\n$initdb\n");
diff --git a/lib/Module/Install/RTx/Factory.pm b/lib/Module/Install/RTx/Factory.pm
index f6c446b..c22ca63 100644
--- a/lib/Module/Install/RTx/Factory.pm
+++ b/lib/Module/Install/RTx/Factory.pm
@@ -5,7 +5,7 @@ use strict;
 use File::Basename ();
 
 sub RTxInitDB {
-    my ($self, $action) = @_;
+    my ($self, $action, $name, $version) = @_;
 
     unshift @INC, substr(delete($INC{'RT.pm'}), 0, -5) if $INC{'RT.pm'};
 
@@ -32,8 +32,12 @@ sub RTxInitDB {
         "--datadir"     => "etc",
         (($action eq 'insert') ? ("--datafile"    => "etc/initialdata") : ()),
         "--dba"         => $RT::DatabaseUser,
-        "--prompt-for-dba-password" => ''
+        "--prompt-for-dba-password" => '',
     );
+
+    push @args, ("--component" => $name, "--ext-version" => $version)
+      if $RT::VERSION >= 4.2;
+
     print "$^X @args\n";
     (system($^X, @args) == 0) or die "...returned with error: $?\n";
 }

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



More information about the Bps-public-commit mailing list