[freeside-commits] freeside/FS/bin freeside-setup,1.68,1.69

Ivan,,, ivan at wavetail.420.am
Wed Jun 30 14:57:16 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv16256

Modified Files:
	freeside-setup 
Log Message:
-T causing problems

Index: freeside-setup
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-setup,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -w -d -r1.68 -r1.69
--- freeside-setup	24 Feb 2009 09:52:25 -0000	1.68
+++ freeside-setup	30 Jun 2010 21:57:14 -0000	1.69
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -Tw
+#!/usr/bin/perl -w
 
 #to delay loading dbdef until we're ready
 BEGIN { $FS::Schema::setup_hack = 1; }
@@ -9,7 +9,7 @@
 $FS::part_pkg::setup_hack = 1;
 
 use strict;
-use vars qw($opt_u $opt_d $opt_v);
+use vars qw($opt_u $opt_d $opt_v $opt_q);
 use Getopt::Std;
 use FS::UID qw(adminsuidsetup datasrc checkeuid getsecrets);
 use FS::CurrentUser;
@@ -24,7 +24,9 @@
 #my %attrib2db =
 #  map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib;
 
-getopts("u:vd:");
+getopts("u:vqd:");
+$opt_v = 1 unless $opt_q; #verbose by default now
+
 my $config_dir = shift || '%%%DIST_CONF%%%' ;
 $config_dir =~ /^([\w.:=\/]+)$/
   or die "unacceptable configuration directory name";
@@ -84,6 +86,8 @@
 # create a dbdef object from the old data structure
 ###
 
+warn "Loading schema objects\n" if $opt_v;
+
 my $dbdef = dbdef_dist(datasrc);
 
 #important
@@ -94,6 +98,8 @@
 # create 'em
 ###
 
+warn "Connecting to database\n" if $opt_v;
+
 $FS::CurrentUser::upgrade_hack = 1;
 $FS::UID::callback_hack = 1;
 my $dbh = adminsuidsetup $opt_u; #$user;
@@ -102,6 +108,8 @@
 #create tables
 $|=1;
 
+warn "Creating tables and indices\n" if $opt_v;
+
 foreach my $statement ( $dbdef->sql($dbh) ) {
   $dbh->do( $statement )
     or die "CREATE error: ". $dbh->errstr. "\ndoing statement: $statement";
@@ -113,14 +121,12 @@
 delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload
 reload_dbdef($dbdef_file);
 
-warn "Freeside schema initialized - commiting transaction\n" if $opt_v;
-
+warn "Tables and indices created - commiting transaction\n" if $opt_v;
 $dbh->commit or die $dbh->errstr;
 $dbh->disconnect or die $dbh->errstr;
-
 warn "Database schema committed successfully\n" if $opt_v;
 
-warn "Initializing freeside configuration\n" if $opt_v;
+warn "Initializing configuration\n" if $opt_v;
 $FS::UID::callback_hack = 1;
 $dbh = adminsuidsetup $opt_u;
 $FS::UID::callback_hack = 0;
@@ -132,21 +138,17 @@
   }
 }
 
-warn "Freeside configuration initialized - commiting transaction\n" if $opt_v;
-
+warn "Configuration initialized - commiting transaction\n" if $opt_v;
 $dbh->commit or die $dbh->errstr;
 $dbh->disconnect or die $dbh->errstr;
-
-warn "Freeside configuration committed successfully\n" if $opt_v;
+warn "Configuration committed successfully\n" if $opt_v;
 
 $dbh = adminsuidsetup $opt_u;
 create_initial_data('domain' => $opt_d);
 
-warn "Freeside database initialized - commiting transaction\n" if $opt_v;
-
+warn "Database initialized - commiting transaction\n" if $opt_v;
 $dbh->commit or die $dbh->errstr;
 $dbh->disconnect or die $dbh->errstr;
-
 warn "Database initialization committed successfully\n" if $opt_v;
 
 sub dbdef_create { # reverse engineer the schema from the DB and save to file
@@ -156,7 +158,7 @@
 }
 
 sub usage {
-  die "Usage:\n  freeside-setup -d domain.name [ -v ] [ config/dir ]\n"
+  die "Usage:\n  freeside-setup -d domain.name [ -q ] [ config/dir ]\n"
   # [ -u user ] for devel/multi-db installs
 }
 



More information about the freeside-commits mailing list