[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.18-60-g2f9e8f0

Alex Vandiver alexmv at bestpractical.com
Wed Nov 13 18:47:09 EST 2013


The branch, 4.0-trunk has been updated
       via  2f9e8f0b703efe5f503753192d48f00395edcd63 (commit)
       via  cd1aa12a2b47cfb55945cc79f43293f16db6e7ee (commit)
      from  358d84ddf85bd5e5b791ff20fa311bfb2da0773b (commit)

Summary of changes:
 sbin/rt-setup-database.in | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit cd1aa12a2b47cfb55945cc79f43293f16db6e7ee
Author: Richard Harman <richard at richardharman.com>
Date:   Tue Oct 8 14:44:24 2013 -0400

    Allow non-interactive database upgrades to rt-setup-database
    
    This patch allows repeatable, scriptable upgrades for testing upgrading.
    It adds two switches to rt-setup-database:
    
    --upgrade-from - Specify the version to start applying upgrade content
    --upgrade-to   - Specify the version to stop applying upgrade content

diff --git a/sbin/rt-setup-database.in b/sbin/rt-setup-database.in
index a53d02b..54c91aa 100644
--- a/sbin/rt-setup-database.in
+++ b/sbin/rt-setup-database.in
@@ -91,6 +91,7 @@ GetOptions(
     'force', 'debug',
     'dba=s', 'dba-password=s', 'prompt-for-dba-password', 'package=s',
     'datafile=s', 'datadir=s', 'skip-create', 'root-password-file=s',
+    'upgrade-from=s', 'upgrade-to=s',
     'help|h',
 );
 
@@ -318,7 +319,7 @@ sub action_upgrade {
         } else {
             print "Enter $args{package} version you're upgrading from: ";
         }
-        $upgrading_from = scalar <STDIN>;
+        $upgrading_from = $args{'upgrade-from'} || scalar <STDIN>;
         chomp $upgrading_from;
         $upgrading_from =~ s/\s+//g;
     } while $upgrading_from !~ /$version_dir/;
@@ -352,7 +353,7 @@ sub action_upgrade {
                 print "\nEnter $args{package} version if you want to stop upgrade at some point,\n";
                 print "  or leave it blank if you want apply above upgrades: ";
             }
-            $custom_upgrading_to = scalar <STDIN>;
+            $custom_upgrading_to = $args{'upgrade-to'} || scalar <STDIN>;
             chomp $custom_upgrading_to;
             $custom_upgrading_to =~ s/\s+//g;
             last unless $custom_upgrading_to;
@@ -593,4 +594,14 @@ administrator privileges
 for 'init' and 'insert': rather than using the default administrative password
 for RT's "root" user, use the password in this file.
 
+=item upgrade-from
+
+for 'upgrade': specifies the version to upgrade from, and do not prompt
+for it if it appears to be a valid version.
+
+=item upgrade-to
+
+for 'upgrade': specifies the version to upgrade to, and do not prompt
+for it if it appears to be a valid version.
+
 =back

commit 2f9e8f0b703efe5f503753192d48f00395edcd63
Merge: 358d84d cd1aa12
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Nov 13 18:42:20 2013 -0500

    Merge branch '4.0/non-interactive-upgrade' into 4.0-trunk


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


More information about the rt-commit mailing list