[Rt-commit] r17803 - in rt/3.999/trunk: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Jan 17 12:52:21 EST 2009


Author: sunnavy
Date: Sat Jan 17 12:52:21 2009
New Revision: 17803

Modified:
   rt/3.999/trunk/   (props changed)
   rt/3.999/trunk/sbin/rt-migrate-db-from-3.8

Log:
 r18872 at sunnavys-mb:  sunnavy | 2009-01-18 01:52:03 +0800
 mv print usage stuff in BEGIN BLOCK to skip loading Jifty stuff unnecessarily, since load Jifty is sort of heavy


Modified: rt/3.999/trunk/sbin/rt-migrate-db-from-3.8
==============================================================================
--- rt/3.999/trunk/sbin/rt-migrate-db-from-3.8	(original)
+++ rt/3.999/trunk/sbin/rt-migrate-db-from-3.8	Sat Jan 17 12:52:21 2009
@@ -8,18 +8,14 @@
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 
-use Jifty::Everything;
-BEGIN {
-    Jifty->new();
-}
-
 my %args;
 
-confess "unknown option"
-  unless GetOptions( \%args, 'db-type=s', 'db-name-rt3=s', 'db-name-rt4=s',
-    'dba=s', 'help' );
+BEGIN {
+    confess "unknown option"
+      unless GetOptions( \%args, 'db-type=s', 'db-name-rt3=s', 'db-name-rt4=s',
+        'dba=s', 'help' );
 
-my $USAGE = <<'END';
+    my $USAGE = <<'END';
 before run, please backup your dbs
 and we need to set up a basic rt4 db with the cmd:
 $ jifty schema --setup --no-bootstrap
@@ -35,11 +31,16 @@
 dba: database administrator
 END
 
-if ( $args{'help'} ) {
-    print $USAGE;
-    exit 0;
+    if ( $args{'help'} ) {
+        print $USAGE;
+        exit 0;
+    }
+
+    use Jifty::Everything;
+    Jifty->new();
 }
 
+
 $args{'db-type'}     ||= 'mysql';
 $args{'db-name-rt3'} ||= 'rt3';
 $args{'db-name-rt4'} ||= 'rt4';


More information about the Rt-commit mailing list